Setting up your development environment

For ICS 215 we will need support for four different programming languages, Python, Perl, PHP, and JavaScript. The following steps will ensure that your laptop will have the tools to develop in all of these languages.

1) Install Python

Python is powerful… and fast;
plays well with others;
runs everywhere;
is friendly & easy to learn;
is Open.

In ICS 215 we will be using Python for two purposes:

  1. Go to the Python Downloads page and download Python 2.7.8 for your particular OS. We are using Python 2.7.8 for compatibility. I’m not sure all the programs will work with Python 3.4.1.
  2. Install Python 2.7.8 on your laptop.
  3. Validate your install. When you type:
$ python

at the command prompt you should see something like:

c:\Python27>python
Python 2.7.8 (v2.7.8:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

This indicates that you have Python v2.7.8 correctly installed. You can type “quit()” or “exit()” to exit the interpreter.

1.5) Install Python setuptools

Go to Install setuptools and install setuptools for your OS. RegExQuiz needs setuptools to correctly install.

2) Install RegExQuiz

RegExQuiz is a simple Python program I wrote to evaluate you knowledge of Regular Expressions.

  1. Download the RegExQuiz-master.zip file.
  2. Unzip the file on your hard drive.
  3. Open a command prompt and change directory to where you unzipped the file.
  4. Run the command python setup.py install You should see something like:
    11:43 [~/tmp/RegExQuiz-master] $ python setup.py install
    running install
    running bdist_egg
    running egg_info
    creating regexquiz.egg-info
    writing regexquiz.egg-info/PKG-INFO
    writing top-level names to regexquiz.egg-info/top_level.txt
    writing dependency_links to regexquiz.egg-info/dependency_links.txt
    writing entry points to regexquiz.egg-info/entry_points.txt
    writing manifest file 'regexquiz.egg-info/SOURCES.txt'
    reading manifest file 'regexquiz.egg-info/SOURCES.txt'
    writing manifest file 'regexquiz.egg-info/SOURCES.txt'
    installing library code to build/bdist.macosx-10.9-x86_64/egg
    running install_lib
    running build_py
    creating build
    creating build/lib
    creating build/lib/regexquiz
    copying regexquiz/__init__.py -> build/lib/regexquiz
    copying regexquiz/cmdline.py -> build/lib/regexquiz
    copying regexquiz/quiz.py -> build/lib/regexquiz
    creating build/bdist.macosx-10.9-x86_64
    creating build/bdist.macosx-10.9-x86_64/egg
    creating build/bdist.macosx-10.9-x86_64/egg/regexquiz
    copying build/lib/regexquiz/__init__.py -> build/bdist.macosx-10.9-x86_64/egg/regexquiz
    copying build/lib/regexquiz/cmdline.py -> build/bdist.macosx-10.9-x86_64/egg/regexquiz
    copying build/lib/regexquiz/quiz.py -> build/bdist.macosx-10.9-x86_64/egg/regexquiz
    byte-compiling build/bdist.macosx-10.9-x86_64/egg/regexquiz/__init__.py to __init__.pyc
    byte-compiling build/bdist.macosx-10.9-x86_64/egg/regexquiz/cmdline.py to cmdline.pyc
    byte-compiling build/bdist.macosx-10.9-x86_64/egg/regexquiz/quiz.py to quiz.pyc
    creating build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
    copying regexquiz.egg-info/PKG-INFO -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
    copying regexquiz.egg-info/SOURCES.txt -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
    copying regexquiz.egg-info/dependency_links.txt -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
    copying regexquiz.egg-info/entry_points.txt -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
    copying regexquiz.egg-info/top_level.txt -> build/bdist.macosx-10.9-x86_64/egg/EGG-INFO
    zip_safe flag not set; analyzing archive contents...
    creating dist
    creating 'dist/regexquiz-1.0-py2.7.egg' and adding 'build/bdist.macosx-10.9-x86_64/egg' to it
    removing 'build/bdist.macosx-10.9-x86_64/egg' (and everything under it)
    Processing regexquiz-1.0-py2.7.egg
    Removing /usr/local/lib/python2.7/site-packages/regexquiz-1.0-py2.7.egg
    Copying regexquiz-1.0-py2.7.egg to /usr/local/lib/python2.7/site-packages
    regexquiz 1.0 is already the active version in easy-install.pth
    Installing regexquiz script to /usr/local/bin

    Installed /usr/local/lib/python2.7/site-packages/regexquiz-1.0-py2.7.egg
    Processing dependencies for regexquiz==1.0
    Finished processing dependencies for regexquiz==1.0
    11:43 [~/tmp/RegExQuiz-master] $ 
  1. Test to see if RegExQuiz is correctly installed. Type regexquiz from the command prompt. You should see something like:

    11:47 [~/tmp/RegExQuiz-master] $ regexquiz

    RegExQuiz! ICS 215 RegEx quizzer.
    Type #question to see the quiz question. Then type in the regular
    expression that solves the question. When you hit return the quizzer
    will show you lines that match that regex, or nothing if nothing matches.
    Type #quit to quit.

    No quiz loaded. Load the quiz using ‘#load_quiz '

    quiz >#quit 11:48 [~/tmp/RegExQuiz-master] $

3) Install XAMPP

XAMPP is the most popular PHP development environment. XAMPP is a completely free, easy to install Apache distribution containing MySQL, PHP, and Perl. The XAMPP open source package has been set up to be incredibly easy to install and to use.

  1. Go to Apache Friends and download XAMPP.
  2. Install XAMPP on your laptop.
  3. Validate the installation by running the xampp_control. You should see a GUI something like: XAMPP Control
  4. Check out the FAQs for your particular OS.

4) Install Perl

Even though XAMPP comes with a Perl support it is for the Apache Web Server and doesn’t support general Perl scripts. So you will have to install Perl for you particular OS.

  1. Go to Perl.org and download Perl
  2. Install Perl on your laptop.
  3. Validate your install. When you type:
$ perl -v

at the command prompt you should see something like:

c:\>perl -v

This is perl 5, version 14, subversion 2 (v5.14.2) built for MSWin32-x86-multi-thread

Copyright 1987-2011, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.


c:\>

5) Install an IDE

All scripts are just text files, so you don’t really need to install an IDE to do script development. However a good IDE will greatly improve you productivity. There are many good IDEs available. I recommend one of the following IDEs for ICS 215:

Run though some of the tutorials for the IDE you choose to become comfortable using your IDE. You should be good at creating new text files in any directory, since this is a key competency of scripting.