This file contains 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.ArrayList; | |
import java.util.List; | |
public class PasswordGen { | |
public static void main(String[] args) { | |
List<Character> cs = new ArrayList<Character>(); | |
cs.add('a'); | |
cs.add('b'); |
This file contains 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.ArrayList; | |
import java.util.List; | |
public class PasswordGen { | |
public static void main(String[] args) { | |
List<Character> cs = new ArrayList<Character>(); | |
cs.add('a'); | |
cs.add('b'); |
This file contains 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.Arrays; | |
import java.util.List; | |
import java.util.Set; | |
import java.util.HashSet; | |
public class SentenceSolver { | |
public static Set<String> EnglishDictionary; | |
static { | |
EnglishDictionary = new HashSet<String>(Arrays.asList(new String[] { |
This file contains 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.Arrays; | |
import java.util.List; | |
import java.util.Set; | |
import java.util.HashSet; | |
import java.util.Stack; | |
public class SentenceSolver { | |
public static Set<String> EnglishDictionary; | |
static { |
This file contains 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
isSorted(root,Integer.MIN_VALUE,Integer.MAX_VALUE); | |
public static boolean isSorted(Node cur, int min, int max) { | |
if (cur==null) { | |
return true; | |
} else if (cur.val < min || cur.val > max) { | |
return false; | |
} else { | |
boolean sorted = true; | |
if (cur.left != null && cur.left.val > cur.val) { |
This file contains 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.io.BufferedReader; | |
import java.io.BufferedWriter; | |
import java.io.FileReader; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.io.PrintWriter; | |
import java.util.ArrayList; | |
import java.util.LinkedList; | |
import java.util.List; | |
import java.util.Queue; |
This file contains 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
(*GENERAL PURPOSE*) | |
ee[m_, e_] := m*10^ e; | |
sci[x_] := ScientificForm[x]; // N | |
getr[rules_, r_] := Replace[r, rules]; | |
(*Complex*) | |
imag[a_, b_] := a + I*b; | |
imagpol[i_] := {Abs[i], ArcTan[Re[i], N[Im[i]]]}; | |
FactorC[p_, x_] := Times @@ Cases[Roots[p == 0, x, Cubics -> False], u_ == v_ -> x - v]; | |
PartialFractionsC[p_, x_] := (Apart[Numerator[#1]/FactorC[Denominator[#1], x], x] &)[Together[p]]; |
This file contains 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.io.*; | |
import java.util.Random; | |
//so unoptimized it isnt even funny | |
public class JavRPG { | |
public static void main(String args[]) { | |
//Intro | |
int level = 1; | |
int gold = 0; | |
int health = 10; |
This file contains 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
#include <dirent.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> | |
#include <stdlib.h> | |
#include <sys/mman.h> | |
#include <sys/types.h> | |
#include <unistd.h> |
This file contains 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
Clear[a, b, c, x] | |
data = {{1, 0.679}, {5, 0.684}, {10, 0.642}, {20, 0.635}, {40, | |
0.622}, {80, 0.614}, {200, 0.611}, {500, 0.605}, {1000, | |
0.598}, {5000, 0.604}, {10000, 0.605}}; | |
range = {{0, 6000}, {0.55, 0.66}}; | |
v2 = ListPlot[data, PlotRange -> range]; | |
Fit[data, {1, Log[x]}, x] | |
dotandfit = Plot[%, {x, 0, 10000}, PlotRange -> range]; | |
v1 = Plot[0.6, {x, 0, 10000}, PlotStyle -> {Red}]; | |
Show[v2, dotandfit]; |
OlderNewer