This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Cipher { | |
private String regularAlphabet; | |
private String key; | |
public Cipher(String keyword, Message message) { | |
regularAlphabet = "abcdefghijklmnopqrstuvwxyz"; | |
key = this.createKey(keyword, message); | |
} | |
public String createKey(String keyword, Message message) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Cipher { | |
private String regularAlphabet; | |
private String cipherAlphabet; | |
public Cipher() { | |
regularAlphabet = "abcdefghijklmnopqrstuvwxyz"; | |
cipherAlphabet = "defghijklmnopqrstuvwxyzabc"; | |
} | |
public Message encrypt(Message message) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import twitter4j.Query; | |
import twitter4j.QueryResult; | |
import twitter4j.Status; | |
import twitter4j.StatusUpdate; | |
import twitter4j.Twitter; | |
import twitter4j.TwitterException; | |
import twitter4j.TwitterFactory; | |
import java.util.ArrayList; | |
public class DankBot { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Cipher { | |
private String regularAlphabet; | |
private String cipherAlphabet; | |
public Cipher(String key) { | |
regularAlphabet = "abcdefghijklmnopqrstuvwxyz"; | |
cipherAlphabet = this.createCipher(key.toLowerCase(), regularAlphabet); | |
} | |
public Message encrypt(Message message) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Date; | |
public class Encryptor { | |
public static void main(String[] args) { | |
String check = ""; | |
for (int i = 0; i < 100000; i++) { | |
check += (char)(Math.random()*27 + 'a'); | |
} | |
Date start = new Date(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Date; | |
import java.util.Random; | |
public class ArrayRepetitionFinder { | |
public static void main(String[] args) { | |
//int[] array = new int[100000000]; | |
Random rand = new Random(); | |
long[] times = new long[10]; | |
/*for (int i = 0; i < array.length; i++) { | |
array[i] = rand.nextInt(9) + 1; | |
}*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NonConsecArray { | |
public int sum(int[] array) { | |
int Sum = 0; | |
int i = 0; | |
if (array.length%2 != 0) { | |
int iTemp = 2; | |
int tempSum = 0; | |
while (i < array.length) { | |
if (i + iTemp >= array.length - 1) { | |
iTemp++; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Location { | |
private double x; | |
private double y; | |
public Location() { | |
x = 0.0; | |
y = 0.0; | |
} | |
public Location(double x, double y) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NewtonMethod { | |
public static void main(String[] args) { | |
NewtonMethod test = new NewtonMethod(); | |
test.calc("4x^3 + 7x^2 + 5x + 6", -2, 5); | |
} | |
public void calc(String polynomial, double firstGuess, int tolerance) { | |
Polynomial p = new Polynomial(polynomial); | |
double newGuess; | |
double oldGuess = firstGuess; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class BasetoBaseConverter { | |
public static void main(String[] args) { | |
Scanner Scan = new Scanner(System.in); | |
BasetoBaseConverter Run = new BasetoBaseConverter(); | |
System.out.println("\fWhat number would you like to convert?"); | |
String input = Scan.nextLine(); | |
String start = input; | |
NewerOlder