...
Section | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Standard Tools
...
- 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 (Nicole Deflaux and Mike Kellen as adminsadmin)
- Code versioning: SubversionGit, hosted by Atlassian as part of our Jira Studio subscriptionon GitHub.
- Build System: Maven
- Build repository manager: see Sage's hosted Artifactory service see jFrog website for info (John Hill and Mike Kellen as admins)
...
MONqrDkXrjMnJciwRtLBAEGFOmnBGjNmbRRWECCaUafBQo
mi2Kehqg3mIlkHdhHlTejumx2KzaGJQIsBkyJf66uTXT7W
NPQQsvpRQnqmPnrRpQPSunQNrOQnnRqMNovXXwssmXtvsW
vSttxsuurRqopnmomUUnovrnuoummmmmUUnovrnuoummmm
mUUJXdbW2flkbqtlohpUUnmmmm
You can also use Jacoco for code coverage. For more information, see Jacoco Code Coverage.
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
- R Installation
- Bioconductor
- Eclipse Plugin for R
- You'll also need to install some tools that R package builds depend upon:
- Windows
- Mac OSX
- Install XCodeso that you have a C compiler
- Be sure to select installation option "UNIX Development Support"
- If you install from the "App Store" and are not presented with this option, the following is a work-around:
After installing Xcode, go to XCode>Preferences...
Go to Downloads > Command Line Tools > Install
Follow the prompts to register as an Apple Developer and download the tools.
- Install MacTex
- Install XCodeso that you have a C compiler
Python
Python Examples for Perl programmers
...
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
- 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
From the shell:
Code Block ~/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
Example: empty dictionary, add values to it
Code Block 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["versionqcBy"] = row[611]
Example: empty two level dictionary, add values to it
Code Block layer = {} layer['foo'] = {} layer['foo']['bar'] = 3 layer["qcBy"'hello'] = row[11]{} layer['hello']['world'] = 42
Example: create a populated dictionary
Code Block CSV_TO_PRIMARY_FIELDS = { 'name': 'name', 'description': 'description', 'Investigator': 'creator', 'Creation Date': 'creationDate', 'Status': 'status', 'date_released': 'releaseDate', 'version':'version' }
Example: create a populated two-level dictionary
Code Block MY_FAKE_LAYER = {'foo': {'bar': 3}, 'hello': {'world': 42}}
Example: empty array, add values to it
Code Block stringAnnotations = [] stringAnnotations.append("foo")
Example: create a populated array
Code Block CSV_SKIP_FIELDS = ["db_id","user_agreement_file_path", "readme_file_path"];
Subversion
...
MySQL
- MySQL Windows installation instructions
- MySQL Workbench - GUI tool for interacting with the MySQL database
Git
For Git info see the Git page. Or maybe you're interested in our Git Workflow instead.
Moving files and directories
The eclipse plugin for svn generally does a decent job Git is pretty smart about moving files and directories. See also http://svnbook.red-bean.com/en/1.1/re18.html
Here is an example:
- You can see that there is a "deleted" file here but it was actually "svn moved" http://sagebionetworks.jira.com/source/browse/PLAY/trunk/src/test/java/com/symform/common
- Old filename http://sagebionetworks.jira.com/source/browse/PLAY/trunk/src/test/java/com/symform/common/TestHelpers.java#r9
- New filename http://sagebionetworks.jira.com/source/browse/PLAY/trunk/src/test/java/com/symform/common/Helpers.java#r41
- You can see that the full svn history is shown on each page.
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
- SVN branch documentation http://svnbook.red-bean.com/en/1.1/ch04s02.html#svn-ch-4-sect-2.1
- svnmerge.py Documentation http://www.orcaware.com/svn/wiki/Svnmerge.py
- Rationale http://kenkinder.com/subversion-merge-tracking-with-svnmerge/
- the
svn switch
command is handy to change the branch for your local checked out copy of code
How to Set Up Merge Tracking
- Download svnmerge.py
- Make a branch directory for yourself (you'll only need to do this once)
Code Block svn mkdir https://sagebionetworks.jira.com/svn/PLFM/branches/deflaux
- Make a new branch from trunk
Code Block svn copy https://sagebionetworks.jira.com/svn/PLFM/trunk https://sagebionetworks.jira.com/svn/PLFM/branches/deflaux/automatedIntegrationTesting
- Have both trunk and your new branch on your local hard drive, this assumes you already have trunk checked out in directory ~/platform
Code Block cd ~/platform svn update trunk svn checkout https://sagebionetworks.jira.com/svn/PLFM/branches/deflaux/automatedIntegrationTesting
- Initialize merge tracking
Code Block 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
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.
- Ensure the branch is working and committed to SVN.
- To see what branches are available for importing, use this command from the branch distribution:
Code Block python svnmerge.py avail
- One of the results should be '/PLFM/trunk'.
- import the changes from trunk into the branch:
Code Block python svnmerge.py merge -S /PLFM/trunk
- Resolve conflicts, compile, test and commit EVERYTHING in the branch.
Merge from your branch to trunk
- Go to an up-to-date local distribution of trunk.
- From the trunk distribution use the 'avail' command (above) to find the branch of interest.
- Use the following command to find the revision(s) of interest:
Code Block python svnmerge.py avail -S <your branch>
- Import the changes from the branch into trunk:
- For all changes
Code Block python svnmerge.py merge -S <your branch>
- For particular changes
Code Block python svnmerge.py merge -r <your revisions comma separated> -S <your branch>
- For all changes
- Resolve conflicts, compile, test and commit.
Elastic Bamboo
We currently have MySQL running on our Elastic Bamboo host for the purposes of integration testing. This is accomplished by the customise-extras.sh shell script which is run at boot time for the hosts.
If you want to import a database dump, install Crowd, etc., here is how to modify that script:
- Log onto the currently running elastic instance (or spawn one if none are running). http://confluence.atlassian.com/display/BAMBOO/Accessing+an+Elastic+Instance
- Note that the ssh key is on
belltown:/work/platform/PasswordsAndCredentials/AtlassianAccountAWSCredentials/elasticbamboo.pk
- Note that if you want to log onto the AWS console, Mike's username and password is on
belltown:/work/platform/PasswordsAndCredentials/AtlassianAccountAWSCredentials/Mike'sPassword
- Note that the ssh key is on
- From the shell try out the commands you want to run at boot time
- Run you build and make sure it works
- Check your changes to customize-extras.sh into source control PLFM/trunk/tools/bamboo/bin/customise-extras.sh
- On the bamboo host, overwrite
/mnt/bamboo-ebs/bin/customise-extras.sh
with your updated script. - Follow these instructions to create snapshot and configure bamboo to use it Updating your EBS snapshot
- Shutdown the host, and kick off a new build. This should start a new bamboo host that will run your updated script.
- Make sure the build passes!
For more information, see:
...
It can even detect that you've renamed a file without you having to tell it so explicitly. Basically, you shouldn't have problems. If you do, write about the solution you found here.
Developer branches
Bottom line. They're easy in git, so USE THEM! For more info see the Git page for resources.
Tools To Know About
Pretty-Print JSON
...
- Firebug http://getfirebug.com/
- Fiddler http://www.fiddler2.com/fiddler2/
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.
...