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
@echo off | |
:: To run the batch file, run CMD as administrator, | |
:: cd to the directory the file is in and enter | |
:: backupmysql.bat <type the user> <type the user password> | |
:: 7-Zip installed in default location is a dependency. | |
:: Use command line arguments as login and password. | |
set dbUser=%1 | |
set dbPassword=%2 |
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.Scanner; | |
import java.util.Stack; | |
public class TunnelThroughTheStacks { | |
public static void main(String[] args) { | |
System.out.println("You find yourself alone in a dark tunnel. Water trickles beneath your feet." + | |
"How you got here, you don't know." + | |
"Is this a dream? You must go somewhere to get out of this tunnel!\n"); | |
Scanner scanner = new Scanner(System.in); | |
int counter = 1; |
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
/* Modified from Listing 10-1 in | |
The Definitive Guide to Java Swing | |
by John Zukowski. | |
*/ | |
import java.awt.*; | |
import javax.swing.*; | |
public class GridBagLayoutExample { | |
private static final Insets insets = new Insets(0, 0, 0, 0); |
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
public class DogHuman extends SuperHuman { | |
public DogHuman(String name, int age) { | |
super(name, age); | |
} | |
@Override | |
public String greet() { | |
return "Woof woof, woof woof, woof woof, woof woof, woof woof"; | |
} |
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.Arrays; | |
import java.util.List; | |
public class ArraysSample { | |
public static void main(String[] args) { | |
List<String> list = new ArrayList<>(); // Create an ArrayList of Strings | |
list.add("CSU"); // Add a String to the ArrayList | |
list.add("Global"); // Add a String to the ArrayList | |
System.out.printf("%s%n", list.toString()); // Print the ArrayList [CSU, Global] |
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 28 columns, instead of 7 in line 5.
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
AtomicNumber,Element,Symbol,AtomicMass,NumberOfNeutrons,NumberOfProtons,NumberOfElectrons,Period,Group,Phase,Radioactive,Natural,Metal,Nonmetal,Metalloid,Type,AtomicRadius,Electronegativity,ionizationEnergy,Density,MeltingPoint,BoilingPoint,stableIsotopes,Discoverer,Year,SpecificHeat,NumberOfShells,NumberOfValence | |
1,Hydrogen,H,1.008,0,1,1,1,1,Gas,,yes,,yes,,Non-Metal,120,2.20,13.5984,0.000090,13.81,20.28,2,Henry Cavendish,1766,14.304,1,1 | |
2,Helium,He,4.003,2,2,2,1,18,Gas,,yes,,yes,,Noble Gas,140,,24.5874,0.000179,0.95,4.22,2,Pierre Janssen - Norman Lockyer and Edward Frankland,1868,5.193,1,2 | |
3,Lithium,Li,7.000,4,3,3,2,1,Solid,,yes,yes,,,Alkali Metal,182,0.98,5.3917,0.534000,453.65,1615.00,2,Johan August Arfvedson - isolated Robert Bunsen and Augustus Mathhiesen,1817,3.582,2,1 | |
4,Beryllium,Be,9.012,5,4,4,2,2,Solid,,yes,yes,,,Alkaline Earth Metal,153,1.57,9.3227,1.850000,1560.00,2744.00,1,Nicholas Louis Vauquelin - isolated Friedrich Wöhler and Antoine A. Bussy [independently],1797,1.825,2,2 | |
5,Boron,B,10.810,6,5, |
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
/* | |
Write a method public static void divisibleByThreeInRange(int beginning, int end) | |
that prints all the numbers divisible by three in the given range. | |
The numbers are to be printed in order from the smallest to the greatest. | |
public static void main(String[] args) { | |
divisibleByThreeInRange(3, 6); | |
} | |
Sample output |
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.Scanner; | |
public class RepeatingBreakingAndRemembering { | |
public static void main(String[] args) { | |
// This exercise is worth five exercise points, and it is | |
// gradually extended part by part. | |
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.FileWriter; | |
import java.io.IOException; | |
/** | |
* Creates a temporary batch file to run curl to download files. | |
* uses the url from args for the command. | |
* This file must be compiled in a class (c:\batch\CurlDownload.class) | |
* to work with the download.bat file. | |
*/ | |
public class CurlDownload { |
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.Random; | |
import java.util.Scanner; | |
public class Security { | |
public static void main(String[] args) { | |
//runServerTests(); | |
randomFloor(); | |
} | |
/** |
NewerOlder