Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 38 Next »

On This page

 

On Related Pages

Standard Tools

These are the tools we have pretty much settled on as a team.  For ease and consistency of development please try to remain on these tools and discuss with the team before introducing competing technologies.

  • Operating System: what ever floats your boat.
  • IDE: Eclipse commonly used and free
  • Wiki / Issue Tracker / Code Browsing and Reviewing / Automated Builds: we have a Jira Studio subscription  (Mike Kellen as admin)
  • Code versioning: Subversion, hosted by Atlassian as part of our Jira Studio subscription
  • Build System: Maven
  • Build repository manager: see Sage's hosted Artifactory service see jFrog website for info (John Hill and Mike Kellen as admins)

Profilers

Code Coverage

We have been approved for free licenses to use Clover (Atlassian Code Coverage tool) for Eclipse. To install the Clover plug-in for eclipse you can use the update site http://update.atlassian.com/eclipse/clover

Eclipse users: Within Eclipse, select from the menu "Window > Preferences" and click on "Clover > License" and paste the above license string into the license text area.

MONqrDkXrjMnJciwRtLBAEGFOmnBGjNmbRRWECCaUafBQo
mi2Kehqg3mIlkHdhHlTejumx2KzaGJQIsBkyJf66uTXT7W
NPQQsvpRQnqmPnrRpQPSunQNrOQnnRqMNovXXwssmXtvsW
vSttxsuurRqopnmomUUnovrnuoummmmmUUnovrnuoummmm
mUUJXdbW2flkbqtlohpUUnmmmm

Java

Libraries

At this point we don't have any strict licensing requirements, however to maintain flexibility we have to be careful about licenses for software we choose to incorporate into our system.  The best licenses are open source licenses without copy-left provisions (e.g. Apache License) that give us maximal flexibility in what we later do with the code base.  Some strong copy-left licenses (e.g. GPL) would impose licensing requirements on us (e.g. force us to use GPL ourselves) if we chose to redistribute the code base at a later date. For now, we should just be aware of the mix of licenses incorporated into our projects, and have a bias for open source, non-copy left licenses.

  • Application Framework: Spring
  • Test: JUnit as test framework, Easy Mock 3.0 for mock objects in unit tests 
  • Mock Objects: Use Mockito to Mock up objects for tests.
  • Dates:
    • All dates should be in ISO-8601 format.
    • ISO-8601 is the default for the joda-time library
    • Use the DateTime object from joda-time. Do not use java.text.DateFormat or java.text.SimpleDateFormat.
    • The reason for doing this is to make the right thing (ISO-8601) the easy thing. If you instead write out your own date formats, date/timezone bugs are easier to create.

R

Python

How to install Python modules

To install easy_install, install the python2.7 version of it from here http://pypi.python.org/pypi/setuptools#files

  1. Make sure you are running the right version of easy_install http://superuser.com/questions/256717/easy-install-the-wrong-version-of-python-modules-mac-os
  2. From the shell:

    ~/platform/trunk>easy_install progressbar
    Searching for progressbar
    Reading http://pypi.python.org/simple/progressbar/
    Reading http://code.google.com/p/python-progressbar/
    Reading http://code.google.com/p/python-progressbar
    Best match: progressbar 2.3
    Downloading http://python-progressbar.googlecode.com/files/progressbar-2.3.tar.gz
    Processing progressbar-2.3.tar.gz
    Running progressbar-2.3/setup.py -q bdist_egg --dist-dir /var/folders/h0/h0pR5063FtCMCzzo1bt2WU+++TI/-Tmp-/easy_install-a29dGI/progressbar-2.3/egg-dist-tmp-3Dwzuw
    zip_safe flag not set; analyzing archive contents...
    Adding progressbar 2.3 to easy-install.pth file
    
    Installed /Library/Python/2.7/site-packages/progressbar-2.3-py2.7.egg
    Processing dependencies for progressbar
    Finished processing dependencies for progressbar
    

Python Examples for Perl programmers

  1. Example: empty dictionary, add values to it

    layer = {}
    layer["type"] = row[1]
    layer["status"] = row[2]
    layer["name"] = row[3]
    layer["numSamples"] = row[4]
    layer["platform"] = row[5]
    layer["version"] = row[6]
    layer["qcBy"] = row[11]
    
  2. Example: empty two level dictionary, add values to it

    layer = {}
    layer['foo'] = {}
    layer['foo']['bar'] = 3
    layer['hello'] = {}
    layer['hello']['world'] = 42
    
  3. Example: create a populated dictionary

    CSV_TO_PRIMARY_FIELDS = {
        'name': 'name',
        'description': 'description',
        'Investigator': 'creator',
        'Creation Date': 'creationDate',
        'Status': 'status',
        'date_released': 'releaseDate',
        'version':'version'
        }
  4. Example: create a populated two-level dictionary

    MY_FAKE_LAYER = {'foo': {'bar': 3}, 'hello': {'world': 42}}
    
  5. Example: empty array, add values to it

    stringAnnotations = []
        stringAnnotations.append("foo")
    
  6. Example: create a populated array

    CSV_SKIP_FIELDS = ["db_id","user_agreement_file_path", "readme_file_path"];
    

MySQL

Subversion

For general SVN info see the SVN book

Moving files and directories

The eclipse plugin for svn generally does a decent job moving files and directories. See also http://svnbook.red-bean.com/en/1.1/re18.html

Here is an example:

svn gets really upset though when you do more complicated things like created a file, delete that file, then make a directory with the same name in the same location as the deleted file. (but that is a pretty odd thing to do anyway)

When in doubt, make a developer branch and try it there first.http://svnbook.red-bean.com/en/1.1/ch04s02.html#svn-ch-4-sect-2.1

Developer branches

Want to make a drastic change and run it by the team before merging it to trunk? Want to check in broken code? Make a branch and do it there.

Resources

How to Set Up Merge Tracking

  1. Download svnmerge.py
  2. Make a branch directory for yourself (you'll only need to do this once)

    svn mkdir https://sagebionetworks.jira.com/svn/PLFM/branches/deflaux
    
  3. Make a new branch from trunk

    svn copy https://sagebionetworks.jira.com/svn/PLFM/trunk https://sagebionetworks.jira.com/svn/PLFM/branches/deflaux/automatedIntegrationTesting
    
  4. Have both trunk and your new branch on your local hard drive, this assumes you already have trunk checked out in directory ~/platform

    cd ~/platform
    svn update trunk
    svn checkout https://sagebionetworks.jira.com/svn/PLFM/branches/deflaux/automatedIntegrationTesting
    
  5. Initialize merge tracking

    cd trunk
    svnmerge.py init ../automatedIntegrationTesting
    svn commit -F svnmerge-commit-message.txt
    cd ../automatedIntegrationTesting
    svnmerge.py init ../trunk
    svn commit -F svnmerge-commit-message.txt
    

Alternative: Initialize merge tracking and switch to your new branch

cd trunk
svnmerge.py init https://sagebionetworks.jira.com/svn/PLFM/branches/deflaux/sts
svn commit -F svnmerge-commit-message.txt
svn switch https://sagebionetworks.jira.com/svn/PLFM/branches/deflaux/sts
svnmerge.py init https://sagebionetworks.jira.com/svn/PLFM/trunk
svn commit -F svnmerge-commit-message.txt

How to merge

Merge from trunk to your branch

Best Practice: merge changes from trunk to your branch every morning Monday through Friday. This reduces the pain later when you want to merge from your branch to trunk.

  1. Ensure the branch is working and committed to SVN.
  2. To see what changes and/or branches are available for importing, use this command from the branch distribution:

    python svnmerge.py avail -l
    
    • Windows Users: One of the results should be '/PLFM/trunk'.
  3. import the changes from trunk into the branch:
    • to merge all changes

      python svnmerge.py merge -S /PLFM/trunk
      
    • to merge one or more particular changes

      python svnmerge.py merge -r #,#,# -S /PLFM/trunk
      
  4. Resolve conflicts, compile, test and commit EVERYTHING in the branch.

    svn ci -F svnmerge-commit-message.txt
    

Merge from your branch to trunk

  1. Go to an up-to-date local distribution of trunk.
  2. From the trunk distribution use the 'avail' command (above) to find the branch of interest.
  3. Use the following command to find the revision(s) of interest:

    python svnmerge.py avail -S <your branch>
    
  4. Import the changes from the branch into trunk:
    1. For all changes

      python svnmerge.py merge -S <your branch>
      
    2. For particular changes

      python svnmerge.py merge -r <your revisions comma separated> -S <your branch>
      
  5. Resolve conflicts, compile, test and commit.

Tools To Know About

Pretty-Print JSON

Have a large blob of JSON?  Want to see it in human readable format?  Toss it into this web ui: http://jsonformatter.curiousconcept.com/

Web Trace Tools

UML Tools

Class Diagrams

UMLet 11.2 is a "Free UML Tool for Fast UML Diagrams" http://www.umlet.com/

Sequence Diagram Editors

Don’t waste your time with drawing programs when you can just write something similar to psuedocode.

Lucene Search

Browse lucene indices with Luke http://www.getopt.org/luke/

  • No labels