Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Add files via upload #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# Java
# Java
Useful library for usaco and other purposes.
. Use releases when possible otherwise download usacotools.java.
# Release dates and more
Find release dates at https://javaarchive.github.io/Java/. Moved to https://github.com/javaarchive/Java/wiki
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-cayman
57 changes: 57 additions & 0 deletions compilestandard.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import java.io.*;
import java.security.MessageDigest;
import java.security.*;
public class compilestandard extends usacotools {
public static String sha256(String input) throws NoSuchAlgorithmException {
MessageDigest mDigest = MessageDigest.getInstance("SHA-256");
byte[] result = mDigest.digest(input.getBytes());
StringBuffer sb = new StringBuffer();
for (int i = 0; i < result.length; i++) {
sb.append(Integer.toString((result[i] & 0xff) + 0x100, 16).substring(1));
}

return sb.toString();
}
public static void main(String[] args) throws IOException{
// TODO Auto-generated method stub
BufferedReader f;
if(args.length==1) {
if(args[0].equals("eclipse")) {
f=mreader("src/usacotools.java");
}else {
f=mreader("usacotools.java");
}

}else {
f=mreader("usacotools.java");
}

print("build");

String st;
String full="";

while ((st = f.readLine()) != null) {
full=full+st+"\n";
}
String text=full.replace("if(!(lock)) {return null;}", "");
text=text.replace("public abstract class usacotools","public abstract class utools");
print(text);
PrintWriter pw=mwriter("utools.java");
if(args[0].equals("eclipse")) {
pw=mwriter("src/utools.java");
}else {

}
pw.println(text);
pw.close();
print("utools.java is the one you should copy into your code but usacotools is the one you should extend");
try{
print("utools.java SHA256: "+sha256(text));
print("usacotools.java SHA256: "+sha256(full));
}catch(Exception e) {
e.printStackTrace();
}

}
}
70 changes: 70 additions & 0 deletions debuggableapp.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import java.io.*;
import java.util.*;
class Var {
private Object object;
public Var() {
this.object=null;
}
public Var(Object o) {
this.object=o;
}
public void set(Object object) { this.object = object; }
public Object get() { return object; }
}
public class debuggableapp {
public static PrintWriter debug;
public static HashMap<String,Var> db=new HashMap<String,Var>();
public static void setup() {
try {
debug=new PrintWriter(new BufferedWriter(new FileWriter("programdebug.info")));
}catch(Exception e) {
e.printStackTrace();
System.out.println("WARNING:Log file cannot be initliazed, redirecting to stdout! This may be a restrcited system!");
debug=new PrintWriter(System.out);

}
debug.println("Setup completed");
}
public static void session() {
debug.println("Session started");
System.out.println("Debug 1.0 Session\nPress enter to stop\nWarning timing this program will be messed up!");
String text=">";
Scanner sc=new Scanner(System.in);
while(!(text.equals(""))) {
System.out.print(">");
text=sc.nextLine();
if(db.containsKey(text)) {
show(db.get(text));
}
}
}
public static void show(Var x) {
debug.println(x.getClass());
if(x.getClass().getName().contains((CharSequence) "List")) {
System.out.println("WARNING this is a list");
debug.println("WARNING this is a list");
}
System.out.println(x.get());
}
public static void add(Var x,String friendlyname) {
db.put(friendlyname, x);
}
public static void set(Var x,String friendlyname) {
db.put(friendlyname, x);



}
public static void main(String[] args) {
setup();
String x="test";
Var a=new Var("Testing");
add(a,x);
session();
a.set("sync test");
Var a2=new Var(new ArrayList<Integer>());
add(a2,"arr");
session();
}

}
19 changes: 19 additions & 0 deletions doc/allclasses-frame.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Mon May 07 19:28:57 PDT 2018 -->
<title>All Classes</title>
<meta name="date" content="2018-05-07">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<h1 class="bar">All&nbsp;Classes</h1>
<div class="indexContainer">
<ul>
<li><a href="usacotools.html" title="class in &lt;Unnamed&gt;" target="classFrame">usacotools</a></li>
</ul>
</div>
</body>
</html>
19 changes: 19 additions & 0 deletions doc/allclasses-noframe.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Mon May 07 19:28:57 PDT 2018 -->
<title>All Classes</title>
<meta name="date" content="2018-05-07">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<h1 class="bar">All&nbsp;Classes</h1>
<div class="indexContainer">
<ul>
<li><a href="usacotools.html" title="class in &lt;Unnamed&gt;">usacotools</a></li>
</ul>
</div>
</body>
</html>
122 changes: 122 additions & 0 deletions doc/class-use/usacotools.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Mon May 07 19:28:57 PDT 2018 -->
<title>Uses of Class usacotools</title>
<meta name="date" content="2018-05-07">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
<script type="text/javascript" src="../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class usacotools";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../usacotools.html" title="class in &lt;Unnamed&gt;">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../overview-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../index-files/index-1.html">Index</a></li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../index.html?class-use/usacotools.html" target="_top">Frames</a></li>
<li><a href="usacotools.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class usacotools" class="title">Uses of Class<br>usacotools</h2>
</div>
<div class="classUseContainer">No usage of usacotools</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../usacotools.html" title="class in &lt;Unnamed&gt;">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../overview-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../index-files/index-1.html">Index</a></li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../index.html?class-use/usacotools.html" target="_top">Frames</a></li>
<li><a href="usacotools.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
Loading