Menu

Tree [bbe03d] master /
 History

HTTPS access


File Date Author Commit
 src 2013-05-12 Hendrik Steller Hendrik Steller [daee7f] Initial commit
 test 2013-05-12 Hendrik Steller Hendrik Steller [daee7f] Initial commit
 .classpath 2013-05-12 Hendrik Steller Hendrik Steller [daee7f] Initial commit
 .project 2013-05-12 Hendrik Steller Hendrik Steller [daee7f] Initial commit
 LICENSE 2013-05-12 Hendrik Steller Hendrik Steller [daee7f] Initial commit
 README 2013-05-12 Hendrik Steller Hendrik Steller [c4d4a7] Hm, it looks like sourceforge will display read...
 build.xml 2013-05-12 Hendrik Steller Hendrik Steller [bbe03d] Renamed the readme file -> needed to update its...
 dna.txt 2013-05-12 Hendrik Steller Hendrik Steller [daee7f] Initial commit
 runExample.sh 2013-05-12 Hendrik Steller Hendrik Steller [daee7f] Initial commit

Read Me

1. Running the solution
2. Contest related stuff


1. Running the solution
The program doesn't have a GUI.
Calling "ant dist" will create a jar and some other files in the
build/dist directory.

You can run the program with

java -jar stringfilter.jar dna.txt



You can use the command line options to supply your own filter definitions
and chain definitions (see below) if you don't want the answers for all the questions.  


2. Some contest related stuff

There's a project on sourceforge.net with a Git repository:
https://sourceforge.net/p/codingcontest5/code/

I implemented two approaches to answer the questions.
They're in the "stringfilter" and "dnaoo" packages respectively.

The main approach is "stringfilter", which is a wannabe framework for processing strings inspired by command line pipes.
The basic idea is to have filter classes which perform simple operations on an input string and create an output string.
By chaining those filter classes, different tasks can be achieved.
With regared to this contest, there's one filterchain defined for each of the questions asked,
with the last filter being one that produces a string containing a human-readable answer to the questions.
(btw. the questions from the contest are referenced as 1_1..1_4 and 2_1..2_3,
following the order of their appearance in the exercise description on the contest website)


The other approach is more OO-oriented.
It uses a DNASequence class and a NucleoBase enum to provide a level of abstraction from the underlying string.
Classes in the "examiners" package examine a DNASequence and provide answers to the contest questions.
Due to a lack of time, some of the examiners are cheating by calling stringfilter classes; 
they have "cheating" in their class name.
The "dnaoo" classes aren't used in the default solution.
There are a couple of test cases using them, among them one test (ComplementTest) which uses
the "dnaoo" and "stringfilter" solutions for question 2_3 (the DNA complement calculation) to ensure
that both implementations return the same complement.

As for the correctness of the solution: 
I don't know what kind of "proof" you expect here.
I would've pointed out that the string filters are rather simple classes which can be (and partly are)
independently tested (sadly, I've no time left to write tests for all of them). 
And chaining a few working filters should produce a "correct" result - assuming the question was understood correctly
(e.g. for the Frømingen's dischrypsia question 2_2: have those purines/pyrimidines occurrences to be distinct or
would 50 purines followed by 42 pyrimidines also be an instance of 4 purines followed by 4 pyrimidines).
But those tests can only test the correctness of the code, not the correctness of the solution.
To test the correctness of the solution, one could employ another "trusted" program like a text editor
to e.g. count how often which character (base) appears in the input.



    
   
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.