Skip to content

Commit

Permalink
lots of namespacing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rodhilton committed Apr 16, 2012
1 parent fd2e4c1 commit c7ae386
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 35 deletions.
4 changes: 2 additions & 2 deletions cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'application'

group = "com.geneticrypt"
version = "SNAPSHOT"
mainClassName = "com.geneticrypt.cli.Main"
mainClassName = "com.nomachetejuggling.geneticrypt.cli.Main"

repositories {
mavenLocal()
Expand Down Expand Up @@ -46,7 +46,7 @@ dependencies {

compile 'commons-cli:commons-cli:1.2'

compile 'com.geneticrypt:geneticrypt-core:SNAPSHOT'
compile 'com.nomachetejuggling.geneticrypt:geneticrypt-core:SNAPSHOT'
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.geneticrypt.cli
package com.nomachetejuggling.geneticrypt.cli

import com.geneticrypt.cli.modules.KeyGen
import com.geneticrypt.cli.modules.Mono
import com.geneticrypt.cli.modules.Crack
import com.nomachetejuggling.geneticrypt.cli.modules.KeyGen
import com.nomachetejuggling.geneticrypt.cli.modules.Mono
import com.nomachetejuggling.geneticrypt.cli.modules.Crack

class Main {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.geneticrypt.cli
package com.nomachetejuggling.geneticrypt.cli

import org.apache.commons.cli.CommandLine
import org.apache.commons.cli.Options
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
package com.geneticrypt.cli.modules
package com.nomachetejuggling.geneticrypt.cli.modules

import com.geneticrypt.cli.Module
import com.geneticrypt.cli.ModuleName
import com.nomachetejuggling.geneticrypt.cli.Module
import com.nomachetejuggling.geneticrypt.cli.ModuleName
import org.apache.commons.cli.Options
import org.apache.commons.cli.CommandLineParser
import org.apache.commons.cli.GnuParser

import org.apache.commons.cli.CommandLine

import static com.geneticrypt.cli.util.Util.readFromStdin
import static com.nomachetejuggling.geneticrypt.cli.util.Util.readFromStdin

import java.security.SecureRandom
import com.geneticrypt.genes.crypt.CryptSequence
import com.geneticrypt.simulator.GeneticSimulator
import com.geneticrypt.simulator.ThreadedGeneticSimulator
import com.geneticrypt.util.UpdateCallback
import com.nomachetejuggling.geneticrypt.genes.crypt.CryptSequence
import com.nomachetejuggling.geneticrypt.simulators.genetic.ThreadedGeneticSimulator
import com.nomachetejuggling.geneticrypt.util.UpdateCallback
import com.google.common.base.Supplier
import com.nomachetejuggling.geneticrypt.simulators.genetic.GeneticSimulator

@ModuleName("crack")
class Crack extends Module {
Expand All @@ -25,7 +24,7 @@ class Crack extends Module {
{
addOption("f", "file", true, "file to crack")
addOption("s", "stdin", false, "read crack text from standard in")
addOption("c", "cipertext", true, "ciphertext to crack")
addOption("t", "text", true, "ciphertext to crack")
}
}
}
Expand All @@ -35,10 +34,8 @@ class Crack extends Module {
def text;
if (cmd.hasOption("s")) {
text = readFromStdin()
crack(ciphertext)
} else if (cmd.hasOption("c")) {
text = cmd.getOptionValue("c")
crack(ciphertext)
} else if (cmd.hasOption("t")) {
text = cmd.getOptionValue("t")
} else if (cmd.hasOption("f")) {
text = new File(cmd.getOptionValue("f")).text
} else {
Expand All @@ -52,7 +49,7 @@ class Crack extends Module {
void crack(final String ciphertext) {
final Random random = new SecureRandom();

GeneticSimulator<CryptSequence> geneticSimulator = new ThreadedGeneticSimulator<CryptSequence>();
GeneticSimulator<CryptSequence> geneticSimulator = new ThreadedGeneticSimulator<CryptSequence>(75);

geneticSimulator.registerUpdates(new UpdateCallback<CryptSequence>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.geneticrypt.cli.modules
package com.nomachetejuggling.geneticrypt.cli.modules

import org.apache.commons.cli.Options

import org.apache.commons.cli.CommandLine

import static java.util.Collections.shuffle
import com.geneticrypt.cli.ModuleName
import com.geneticrypt.cli.Module
import com.nomachetejuggling.geneticrypt.cli.ModuleName
import com.nomachetejuggling.geneticrypt.cli.Module

@ModuleName("keygen")
class KeyGen extends Module {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.geneticrypt.cli.modules
package com.nomachetejuggling.geneticrypt.cli.modules

import com.geneticrypt.cli.ModuleName
import com.geneticrypt.cli.Module
import com.nomachetejuggling.geneticrypt.cli.ModuleName
import com.nomachetejuggling.geneticrypt.cli.Module
import org.apache.commons.cli.Options

import org.apache.commons.cli.CommandLine

import com.geneticrypt.ciphers.MonoSubstitutionCipher
import com.nomachetejuggling.geneticrypt.ciphers.MonoSubstitutionCipher

import com.geneticrypt.cli.util.Util
import com.nomachetejuggling.geneticrypt.cli.util.Util

@ModuleName("mono")
class Mono extends Module{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.geneticrypt.cli.util
package com.nomachetejuggling.geneticrypt.cli.util

class Util {
static String readFromStdin() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.geneticrypt.cli;
package com.nomachetejuggling.geneticrypt.cli;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
2 changes: 1 addition & 1 deletion frontend/application.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Griffon Metadata file
#Sun Apr 15 18:09:29 MDT 2012
#Sun Apr 15 22:17:38 MDT 2012
app.griffon.version=0.9.5-rc2
app.name=frontend
app.toolkit=swing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class FrontendController {

model.originalCipherText = model.cipherText

simulator = new ThreadedGeneticSimulator<CryptSequence>();
simulator = new ThreadedGeneticSimulator<CryptSequence>(75);

simulator.registerUpdates(new UpdateCallback<CryptSequence>() {
@Override
Expand Down

0 comments on commit c7ae386

Please sign in to comment.