diff --git a/about.html b/about.html new file mode 100644 index 000000000..5d9684940 --- /dev/null +++ b/about.html @@ -0,0 +1,58 @@ + + + + + + + About The Company + + + + + + +
+ +

About
Us

+ +
+ +
+ +
+ + +
+

Mission

+

Information

+
+ + +
+

Staff

+

Staff Name

+

Staff info and credentials

+
+ + + + \ No newline at end of file diff --git a/backChallenge.java b/backChallenge.java new file mode 100644 index 000000000..38542e05d --- /dev/null +++ b/backChallenge.java @@ -0,0 +1,100 @@ +import java.io.BufferedReader; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.FileReader; +import java.io.FileNotFoundException; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.Scanner; +import java.util.StringTokenizer; +import org.json.simple.*; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; + +public class backChallenge { + private static HttpURLConnection connection; + private static StringBuffer data; + + public backChallenge(int[] numArray, JSONObject o) { + BufferedReader reader; + data = new StringBuffer(); + try { + URL url = new URL("https://api.github.com/repos/Headstorm/Interview/contents/challenges/data?ref=master"); + connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("PUT"); + connection.setDoOutput(true); + connection.setRequestProperty("Content-Type", "application/json"); + connection.setRequestProperty("Accept", "application/json"); + OutputStreamWriter os = new OutputStreamWriter(connection.getOutputStream()); + + // JSONObject jOb = new JSONObject(); + //jOb.put("accept", "application/vnd.github.v3+json"); + // jOb.put("path", "challenges/data/newNumbers.json"); + //jOb.put("name", "JSON Data Numbers"); + //jOb.put("content", o); + String content = ("{\"accept\":\"application/vnd.github.v3+json\", " + + " \"message\": \"JSON Data Numbers\", \"path\": \"challenges/data/newNumbers.json\"," + + "\"content\": " + o); + + System.out.print(content); + os.write(content); + + int status = connection.getResponseCode(); + if (status != 200 && status!= 201) { + System.out.println("Error: " + status); + System.exit(0); + } + } + catch (Exception e){ + e.printStackTrace(); + } + } + + public static void main(String[] args) throws IOException { + System.out.println("Enter file name with JSON list of 500 numbers and press enter."); + Scanner in = new Scanner(System.in); + String fileName = in.next(); + JSONParser parser = new JSONParser(); + int[] numArray = new int[500]; + + try { + Object o = parser.parse(new FileReader(fileName)); + JSONObject jObj = (JSONObject) o; + String numbers = jObj.get("data").toString(); + StringTokenizer tokens = new StringTokenizer(numbers, "[*,\s*]*"); + + int count = 0; + while (tokens.hasMoreTokens() || count > 500) { + numArray[count] = (int) Integer.parseInt(tokens.nextToken()); + count++; + } + if (count != 500) { + System.out.println("Error - JSON Object must contain exactly 500 numbers"); + System.exit(0); + } + new backChallenge(numArray, jObj); + } + catch (FileNotFoundException fe) { + fe.printStackTrace(); + System.out.println("Error - file not found. Please make sure to type in file name with extension (ie 'filename.txt'"); + System.exit(0); + } + catch (ParseException pe) { + pe.printStackTrace(); + System.out.println("Error - Please make sure file contains JSON with key 'data' and value as 500 numbers separated by commas"); + System.exit(0); + } + catch (ClassCastException cce) { + cce.printStackTrace(); + System.out.println("Error - Please make sure all elements in list are numbers only"); + System.exit(0); + } + catch (Exception e) { + e.printStackTrace(); + System.out.println("Error - Please try again"); + System.exit(0); + } + + + } +} \ No newline at end of file diff --git a/business.jpg b/business.jpg new file mode 100644 index 000000000..20e2ed243 Binary files /dev/null and b/business.jpg differ diff --git a/business2.jpg b/business2.jpg new file mode 100644 index 000000000..faadcffb2 Binary files /dev/null and b/business2.jpg differ diff --git a/companystyle.css b/companystyle.css new file mode 100644 index 000000000..5828abc7d --- /dev/null +++ b/companystyle.css @@ -0,0 +1,148 @@ +h2 { + text-align: left; +} +h3 { + text-align: center; + font-size: 22px; + font-family: Verdana, Arial, sans-serif +} +.header { + padding-bottom: 200px; + background-color: black; +} +#logo { + width: 15%; + padding: 10px 10px; + float: left; + clear: right; +} +#frontpage { + width: 20%; + text-align: left; + float: left; + clear: right; + color: white; + padding: 10px 10px; + font-weight: bold; + font-size: 45px; + font-family: Verdana, Arial, sans-serif; +} +#headimg { + width: 60%; + float: left; + opacity: 75%; + padding: 10px 5px; +} +#headimg:hover { + opacity: 100%; +} +.listnav { + list-style-type: none; + margin: 0; + padding: 5px 0; +} +.nav { + float: left; + text-align: center; + width: 33.33%; + background-color: #000000; +} +.nav a{ + display: block; + text-decoration: none; + font-size: 18px; + font-weight: bold; + color: #ff0000; + padding-top: 5px; + height: 25px; +} +.nav a:visited { + color: #ff9999; +} +.nav a:hover { + color: #800000; + background-color: #a3a3c2; +} +.fronthead { + width: 49%; + margin-left: 5px; + margin-right: 5px; + padding-bottom: 5px; + padding-top: 5px; +} +.frontpic { + width: 49%; + margin-left: 5px; + margin-right: 5px; + padding-bottom: 5px; + padding-top: 5px; +} +#firsthead { + float: left; +} +#firstpic { + float: left; + clear: right; +} +#secondpic { + float: left; +} +#secondhead { + float: left; + clear: right; +} +#contact{ + float: left; + clear: both; + width: 50%; + margin-right: 10px; + padding-bottom: 10px; + padding-top: 10px; + text-align: center; +} +.leftabout { + width: 45%; + float: left; + clear: right; + margin-left: 5px; + margin-right: 5px; + padding-bottom: 5px; + padding-top: 5px; +} +.rightabout { + width: 45%; + float: left; + margin-left: 5px; + margin-right: 5px; + padding-bottom: 5px; + padding-top: 5px; +} +.leftproduct { + width: 31%; + float: left; + clear: right; + margin-left: 5px; + padding-bottom: 5px; + padding-top: 5px; +} +.middleproduct { + width: 31%; + float: left; + clear: right; + padding-left: 5px; + padding-right: 5px; + padding-bottom: 5px; + padding-top: 5px; +} +.rightproduct { + width: 31%; + float: left; + margin-right: 5px; + padding-bottom: 5px; + padding-top: 5px; +} +.product { + display: block; + margin-left: auto; + margin-right: auto; +} \ No newline at end of file diff --git a/form.php b/form.php new file mode 100644 index 000000000..88b1996d0 --- /dev/null +++ b/form.php @@ -0,0 +1,23 @@ + 'true')); + } else { + echo json_encode(array('success' => 'false')); + } + +} ?> diff --git a/logo.png b/logo.png new file mode 100644 index 000000000..43d0650d6 Binary files /dev/null and b/logo.png differ diff --git a/num.json b/num.json new file mode 100644 index 000000000..ccbae2dd1 --- /dev/null +++ b/num.json @@ -0,0 +1 @@ +{"data" : [4,81,20,43,3,48,71,51,16,47,77,83,36,37,69,72,41,73,49,49,5,57,46,63,65,3,17,98,8,22,85,0,32,47,94,35,22,24,8,31,3,46,42,63,22,49,81,43,5,35,53,34,30,50,59,68,39,97,23,35,4,89,65,16,66,84,72,62,43,88,89,24,58,44,46,98,38,43,99,99,40,0,9,14,26,12,82,9,70,17,96,49,63,25,92,51,28,38,28,3,69,77,4,51,47,35,56,61,81,37,33,63,34,94,46,39,34,82,85,71,15,36,31,81,60,66,16,39,43,15,44,7,53,51,1,20,16,73,44,2,24,30,77,98,9,66,77,6,58,75,14,52,40,96,78,31,61,30,5,1,1,89,2,82,93,43,15,24,19,18,48,99,40,69,93,8,66,18,3,85,6,58,70,9,2,54,25,70,84,76,15,53,68,96,13,83,89,68,86,76,30,73,64,46,89,8,35,43,45,69,27,5,2,49,69,80,56,75,96,43,79,19,24,83,43,58,47,15,58,86,38,29,0,20,48,79,0,80,53,17,87,45,80,70,64,27,20,85,5,97,41,88,13,71,29,15,14,27,54,52,23,20,26,49,13,2,54,18,45,36,74,61,96,5,69,41,34,1,32,36,15,69,9,21,26,99,58,30,86,77,95,11,80,54,76,66,44,10,22,29,56,67,40,18,65,57,16,60,90,62,63,98,77,97,99,6,77,84,92,41,92,76,38,9,1,90,55,30,18,95,14,90,43,92,20,9,61,65,45,1,49,57,70,23,73,72,8,66,62,69,4,8,9,2,56,3,5,17,56,14,36,18,19,62,88,54,89,79,47,69,53,2,59,95,58,24,95,51,37,5,16,49,17,61,40,26,69,65,52,84,93,75,26,12,44,99,57,64,53,96,87,15,88,16,78,16,74,5,81,16,49,93,1,30,84,71,94,72,34,95,31,6,18,96,7,16,8,16,55,42,54,30,26,15,46,38,11,62,28,88,5,3,83,63,22,15,43,5,99,99,60,33,42,67,41,74,77,61,37,10,78,55,75,7,81,80,62,72,77,29,57,79,54,9,70,85,30,20,21,80,15,38,20,48,32,43,40,40,81,67,28,42,56,23,2,43,27,15,7,32]} \ No newline at end of file diff --git a/product.jpg b/product.jpg new file mode 100644 index 000000000..322d607f1 Binary files /dev/null and b/product.jpg differ diff --git a/products.html b/products.html new file mode 100644 index 000000000..2af9fda74 --- /dev/null +++ b/products.html @@ -0,0 +1,79 @@ + + + + + + + The Company Products + + + + + + +
+ +

Our
Products

+ +
+ +
+ +
+ + +
+

New Product

+ +

More information

+

Product information


+

Another Product

+ +

More information

+

Product information

+
+ +
+

Product

+ +

More information

+

Product information


+

Product

+ +

More information

+

Product information

+
+ +
+

Product

+ +

More information

+

Product information


+

Product

+ +

More information

+

Product information

+
+ + + + \ No newline at end of file diff --git a/readme-challenge1 b/readme-challenge1 new file mode 100644 index 000000000..364989286 --- /dev/null +++ b/readme-challenge1 @@ -0,0 +1,4 @@ +website.html contains the main logic. All files (about.html, business.jpg, business2.jpg, companystyle.css, form.php, logo.png, product.jpg, and products.html) +should be in the same location when launching website.html. + +Unsure if recaptcha will work, have had it work on and off on my own end. diff --git a/readme-challenge2 b/readme-challenge2 new file mode 100644 index 000000000..33d19b984 --- /dev/null +++ b/readme-challenge2 @@ -0,0 +1,2 @@ +Unfinished +Includes num.json as an example json file and backChallenge.java with the main logic diff --git a/website.html b/website.html new file mode 100644 index 000000000..37c4098c3 --- /dev/null +++ b/website.html @@ -0,0 +1,120 @@ + + + + + + The Company + + + + + + + + +
+ +

The
Company

+ +
+ +
+ +
+ + +
+

Heading

+

Information


+
+ +
+ +
+ +
+ +
+ +
+

Heading

+

Information


+
+ + +
+

Contact

+

Please fill out and submit the entire form.

+

+ First Name:
+ Last Name:
+

First and last name must contain only letters

+ Email Address:
+ Phone Number:
+

Please format phone number as (xxx)xxx-xxxx

+ Enter your brief comment, question, or concern here: +

What is your preferred form of contact?

+ + + +

+
+ + + +
+ \ No newline at end of file