Skip to content

Commit

Permalink
trying to merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Razvan Kusztos committed Feb 8, 2016
2 parents 7665a2b + d9fa18f commit a1c509c
Show file tree
Hide file tree
Showing 91 changed files with 3,435 additions and 10,237 deletions.
10 changes: 10 additions & 0 deletions computations/ComputationCode.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package computations;

import java.io.InputStream;
import java.io.OutputStream;

//A Java object to hold the code for a computation.
public interface ComputationCode {
//This method contains the code to complete the job.
public void run(InputStream input, OutputStream output);
}
54 changes: 54 additions & 0 deletions computations/PrimeComputationCode.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package computations;

import java.io.InputStream;
import java.util.Scanner;

import java.io.OutputStream;
import java.nio.charset.StandardCharsets;

public class PrimeComputationCode implements ComputationCode {
private long prime;
private long startNumber;
private long finishNumber;
private long factor = 0;


//Expect input of the form
//prime lowerBound upperBound
@Override
public void run(InputStream input, OutputStream output) {

//Parse our input data
try {
Scanner s = new Scanner(input);
prime = s.nextLong();
startNumber = s.nextLong();
finishNumber = s.nextLong();
s.close();
} catch(Exception e) {
e.printStackTrace();
throw new RuntimeException("PrimeComputationCode failed to parse arguments.");
}


//The checking for a factor
//Super inefficient I know
for(long i = startNumber; i<finishNumber; i++) {
if(prime % i == 0) {
factor = i;
break;
}
}


//Package up our result
//0 means no factor found
String result = Long.toString(factor);
try {
output.write(result.getBytes(StandardCharsets.UTF_8));
} catch(Exception e) {
throw new RuntimeException("PrimeComputationCode failed to package result");
}
return;
}
}
1 change: 1 addition & 0 deletions tworkserver/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ project/target
.classpath
*.bat
LICENCE
.sbtserver
Empty file added tworkserver/.metadata/.lock
Empty file.
Binary file not shown.
Binary file not shown.
Binary file added tworkserver/.metadata/.mylyn/.tasks.xml.zip
Binary file not shown.
Binary file added tworkserver/.metadata/.mylyn/repositories.xml.zip
Binary file not shown.
Binary file added tworkserver/.metadata/.mylyn/tasks.xml.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
version=1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\n<launchPerspectives/>\n
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
action=ASK
eclipse.preferences.version=1
rememberSendAction=NONE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
content_assist_proposals_background=255,255,255
content_assist_proposals_foreground=60,60,60
eclipse.preferences.version=1
fontPropagated=true
org.eclipse.jdt.ui.editor.tab.width=
org.eclipse.jdt.ui.formatterprofiles.version=12
org.eclipse.jdt.ui.javadoclocations.migrated=true
org.eclipse.jface.textfont=1|Monospace|10.0|0|GTK|1|;
proposalOrderMigrated=true
spelling_locale=en_GB
spelling_locale_initialized=true
tabWidthPropagated=true
useAnnotationsPrefPage=true
useQuickDiffPrefPage=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.m2e.discovery.pref.projects=
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
mylyn.attention.migrated=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.mylyn.monitor.activity.tracking.enabled.checked=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
eclipse.preferences.version=1
migrated.task.repositories.secure.store=true
org.eclipse.mylyn.tasks.ui.filters.nonmatching=true
org.eclipse.mylyn.tasks.ui.filters.nonmatching.encouraged=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PROBLEMS_FILTERS_MIGRATE=true
eclipse.preferences.version=1
platformState=1454357554837
quickStart=false
tipsAndTricks=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
showIntro=false
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//org.eclipse.ui.commands/state/org.eclipse.ui.navigator.resources.nested.changeProjectPresentation/org.eclipse.ui.commands.radioState=false
PLUGINS_NOT_ACTIVATED_ON_STARTUP=org.eclipse.m2e.discovery;
eclipse.preferences.version=1
2,325 changes: 2,325 additions & 0 deletions tworkserver/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
����version
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NRM�
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
����version
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NRM�
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<typeInfoHistroy/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<qualifiedTypeNameHistroy/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart">
<item value="2" key="layout"/>
<item value="true" key="group_libraries"/>
<item value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#x0A;&lt;packageExplorer group_libraries=&quot;1&quot; layout=&quot;2&quot; linkWithEditor=&quot;0&quot; rootMode=&quot;1&quot; workingSetName=&quot;Aggregate for window 1454853474594&quot;&gt;&#x0A;&lt;customFilters userDefinedPatternsEnabled=&quot;false&quot;&gt;&#x0A;&lt;xmlDefinedFilters&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.StaticsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.mylyn.java.ui.MembersFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.NonJavaProjectsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer_patternFilterId_.*&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.NonSharedProjectsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.SyntheticMembersFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.ContainedLibraryFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.internal.ui.PackageExplorer.HideInnerClassFilesFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.internal.ui.PackageExplorer.EmptyInnerPackageFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.m2e.MavenModuleFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.ClosedProjectsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.EmptyLibraryContainerFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.PackageDeclarationFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.ImportDeclarationFilter&quot; isEnabled=&quot;true&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.NonJavaElementFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.LibraryFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.CuAndClassFileFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.internal.ui.PackageExplorer.EmptyPackageFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.NonPublicFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.LocalTypesFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;child filterId=&quot;org.eclipse.jdt.ui.PackageExplorer.FieldsFilter&quot; isEnabled=&quot;false&quot;/&gt;&#x0A;&lt;/xmlDefinedFilters&gt;&#x0A;&lt;/customFilters&gt;&#x0A;&lt;/packageExplorer&gt;" key="memento"/>
<item value="1" key="rootMode"/>
<item value="false" key="linkWithEditor"/>
</section>
<section name="JavaElementSearchActions">
</section>
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<configuration scan="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date [%thread] %-5level %logger{35} - %msg%n</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>OFF</level> <!-- change to DEBUG to mimic '-consolelog' behaviour -->
</filter>
</appender>

<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${org.eclipse.m2e.log.dir}/0.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<FileNamePattern>${org.eclipse.m2e.log.dir}/%i.log</FileNamePattern>
<MinIndex>1</MinIndex>
<MaxIndex>10</MaxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>100MB</MaxFileSize>
</triggeringPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date [%thread] %-5level %logger{35} - %msg%n</pattern>
</encoder>
</appender>

<appender name="EclipseLog" class="org.eclipse.m2e.logback.appender.EclipseLogAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
</appender>

<appender name="MavenConsoleLog" class="org.eclipse.m2e.logback.appender.MavenConsoleAppender">
</appender>

<root level="INFO">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
<appender-ref ref="EclipseLog" />
<appender-ref ref="MavenConsoleLog" />
</root>

<logger name="com.ning.http.client" level="INFO" />
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<setup:Workspace
xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
name="workspace"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="ExternalProjectImportWizard">
<item value="false" key="WizardProjectsImportPage.STORE_NESTED_PROJECTS"/>
<item value="false" key="WizardProjectsImportPage.STORE_COPY_PROJECT_ID"/>
<item value="false" key="WizardProjectsImportPage.STORE_ARCHIVE_SELECTED"/>
<list key="WizardProjectsImportPage.STORE_DIRECTORIES">
<item value="/home/razvan/groupproject/team_mike/tworkserver"/>
</list>
<list key="WizardProjectsImportPage.STORE_ARCHIVES">
<item value=""/>
</list>
</section>
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="org.eclipse.ui.internal.QuickAccess">
<item value="-1" key="dialogHeight"/>
<item value="-1" key="dialogWidth"/>
<list key="textEntries">
</list>
<list key="orderedElements">
</list>
<list key="orderedProviders">
</list>
<list key="textArray">
</list>
</section>
<section name="NewWizardAction">
</section>
<section name="ImportExportAction">
</section>
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<workingSetManager>
<workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1454853474594_0" label="Window Working Set" name="Aggregate for window 1454853474594"/>
</workingSetManager>
3 changes: 3 additions & 0 deletions tworkserver/.metadata/version.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Sun Feb 07 14:05:31 GMT 2016
org.eclipse.core.runtime=2
org.eclipse.platform=4.5.1.v20150904-0015
2 changes: 1 addition & 1 deletion tworkserver/.settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Generated by sbteclipse
#Sun Feb 07 10:21:11 GMT 2016
#Sun Feb 07 14:37:32 GMT 2016
encoding/<project>=UTF-8
2 changes: 1 addition & 1 deletion tworkserver/.settings/org.scala-ide.sdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Generated by sbteclipse
#Sun Feb 07 10:21:11 GMT 2016
#Sun Feb 07 14:37:32 GMT 2016
scala.compiler.additionalParams=-encoding utf8
deprecation=true
unchecked=true
Expand Down
2 changes: 2 additions & 0 deletions tworkserver/app/computations/BasicComputationGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.UUID;

//This generates a simple computation, like the prime class, where all the input and results can fit in memory.
//This class MUST have NO STATE whatsoever.
public interface BasicComputationGenerator {
//Should have a default constructor.

Expand All @@ -12,5 +13,6 @@ public interface BasicComputationGenerator {

//Once the computation finishes, call this to collate the results
//UUID of Computation
//Should NOT make changes to db
public String getResult(UUID computationID);
}
Loading

0 comments on commit a1c509c

Please sign in to comment.