Skip to content
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
98 changes: 98 additions & 0 deletions api.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
[
{
"id": 849,
"question": "How to remove the docker container with container id mentioned in the command.",
"description": null,
"answers": {
"answer_a": "$ docker rm -rf 9b6343d3b5a0",
"answer_b": "$ docker -rm rf 9b6343d3b5a0",
"answer_c": "$ docker rm 9b6343d3b5a0",
"answer_d": null,
"answer_e": null,
"answer_f": null
},
"multiple_correct_answers": "false",
"correct_answers": {
"answer_a_correct": "false",
"answer_b_correct": "false",
"answer_c_correct": "true",
"answer_d_correct": "false",
"answer_e_correct": "false",
"answer_f_correct": "false"
},
"correct_answer": "answer_a",
"explanation": null,
"tip": null,
"tags": [
{
"name": "Docker"
}
],
"category": "Docker",
"difficulty": "Easy"
},
{
"id": 26,
"question": "What is a daemon?",
"description": null,
"answers": {
"answer_a": "It is a generic name for e-mail servers on Linux. The most famous one is mailer-daemon",
"answer_b": "It is a program that keeps running on the background after it is called, answering to requests done by users and other programs.",
"answer_c": "It is an antivirus for Linux.",
"answer_d": "It is the generic name for any Linux server.",
"answer_e": null,
"answer_f": null
},
"multiple_correct_answers": "false",
"correct_answers": {
"answer_a_correct": "false",
"answer_b_correct": "true",
"answer_c_correct": "false",
"answer_d_correct": "false",
"answer_e_correct": "false",
"answer_f_correct": "false"
},
"correct_answer": "answer_b",
"explanation": null,
"tip": null,
"tags": [
{
"name": "Linux"
}
],
"category": "Linux",
"difficulty": "Medium"
},
{
"id": 627,
"question": "How can we set infinite execution time for a PHP script?",
"description": null,
"answers": {
"answer_a": "Add set_time_limit() at the beginning of a script",
"answer_b": "Add set_time_limit(infinity) at the beginning of a script",
"answer_c": "Add set_time_limit(0) at the beginning of a script",
"answer_d": null,
"answer_e": null,
"answer_f": null
},
"multiple_correct_answers": "false",
"correct_answers": {
"answer_a_correct": "false",
"answer_b_correct": "false",
"answer_c_correct": "true",
"answer_d_correct": "false",
"answer_e_correct": "false",
"answer_f_correct": "false"
},
"correct_answer": "answer_a",
"explanation": null,
"tip": null,
"tags": [
{
"name": "PHP"
}
],
"category": "Code",
"difficulty": "Medium"
}
]
10 changes: 6 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ repositories {
}

dependencies {
// implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
// implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-websocket'
// implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'org.postgresql:postgresql'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
// testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'org.springframework.security:spring-security-test'
implementation 'com.google.code.gson:gson:2.8.8'
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
}

test {
Expand Down
115 changes: 115 additions & 0 deletions json.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
[
{
"id": 1,
"school": "Donald Bren School of Information and Computer Sciences",
"title": "Interactive Technology Studio",
"course_level": "Graduate/Professional Only (200+)",
"description": "Technologies, languages, and skills required for creating prototypes to communicate interactive technology concepts. Topics include HTTP, CSS, CSS scripting, AJAX, Design Patterns, Javascript, Javascript libraries such as jQuery, SQL, MVC, and cloud architectures.",
"image":"https://united-pop.com/website/var/tmp/image-thumbnails/0/3214/thumb__diplomaCourseDetail/interactive_audio_designer~-~480w.jpeg"},
{
"id": 2,

"school": "Donald Bren School of Information and Computer Sciences",
"title": "Programming in Java as a Second Language",
"course_level": "Lower Division (1-99)",

"description": "An introduction to the lexical, syntactic, semantic, and pragmatic characteristics of the Java language for experienced programmers. Emphasis on object-oriented programming, using standard libraries, and programming with automatic garbage collection.",
"image":"https://miro.medium.com/max/750/1*HuoU7i1AIvkUSApmIx8XQw.png"},
{
"id": 3,

"school": "Donald Bren School of Information and Computer Sciences",
"title": "Computer Game Development",
"course_level": "Graduate/Professional Only (200+)",

"description": "Introduction to the principles of interactive 2D and 3D computer game development. Concepts in computer graphics, algorithms, software engineering, art and graphics, music and sound, story analysis, and artificial intelligence are presented and are the basis for student work.",
"image":"https://images.ctfassets.net/3s5io6mnxfqz/32WnMVURX2H9rRiNA1qbsg/a93ccb573ad78895d20bccbfdeece606/AdobeStock_345938875.jpeg?fm=jpg&w=900&fl=progressive"},
{
"id": 4,

"school": "Donald Bren School of Information and Computer Sciences",
"title": "Artificial Intelligence in Biology and Medicine",
"course_level": "Upper Division (100-199)",

"description": "Introduction to computational methods in molecular biology, aimed at those interested in learning about this interdisciplinary area. Covers computational approaches to understanding and predicting the structure, function, interactions, and evolution of DNA, RNA, proteins, and related molecules and processes.",
"image" : "https://th.bing.com/th/id/OIP.5snHE-VIA-roO_oqBZDjswHaE8?pid=ImgDet&rs=1"
},
{
"id": 5,

"school": "Donald Bren School of Information and Computer Sciences",
"title": "Digital Image Processing",
"course_level": "Upper Division (100-199)",

"description": "Introduction to the fundamental concepts of digital signal and image processing as applicable in areas such as multimedia, graphics, AI, data mining, databases, vision, or video games. Topics include image representation, space- and frequency-domain transformations, filters, segmentation, and compression.",
"image" : "https://online.stanford.edu/sites/default/files/styles/figure_default/public/2018-03/ee_digitalimageprocessing_ee368.jpg?itok=S2vGmtU4"
},
{
"id": 6,

"school": "School of Physical Sciences",
"title": "Advanced Data Acquisition and Analysis",
"course_level": "Graduate/Professional Only (200+)",

"description": "Introduces students to a variety of practical laboratory techniques, including lock-in, boxcar, coincidence counting, noise filtering, PID control, properties of common transducers, computer interfacing to instruments, vacuum technology, laboratory safety, basic mechanical design, and shop skills. Materials fee.",
"image" : "https://learn.g2.com/hubfs/what-is-advanced-analytics.jpg"
},
{
"id": 7,

"school": "Donald Bren School of Information and Computer Sciences",
"title": "Artificial Intelligence Frontiers: Technical, Ethical, and Societal",
"course_level": "Upper Division (100-199)",

"description": "Explores the frontiers of artificial intelligence and related technologies with a focus on the underlying ethical, legal, and societal challenges and opportunities they create. Encourages critical thinking about these issues.",
"image" : "https://www.insurancejournal.com/app/uploads/2016/01/ethics-580x580.jpg"
},
{
"id": 8,

"school": "The Henry Samueli School of Engineering",
"title": "Biomedical Big Data",
"course_level": "Graduate/Professional Only (200+)",

"description": "Analysis and visualization of large biomedical datasets. Topics covered include cloud computing, learning Structured Query Language (SQL), database normalization and joins, using Google’s BigQuery, using the statistical analysis package R, machine learning algorithms, application of machine learning for classification problems.",
"image" : "https://prod-discovery.edx-cdn.org/media/course/image/63f8ec13-8c6b-4c70-b380-3f95e56a21f6-d8de3c31749c.small.jpg"
},
{
"id": 9,

"school": "Donald Bren School of Information and Computer Sciences",
"title": "Network Security",
"course_level": "Graduate/Professional Only (200+)",

"description": "Introduction to network security, including network threats and attacks, as well as defenses against such attacks. Topics include network infrastructure security, mobile and Wi-Fi security, spam, phishing, firewalls, anonymity, secure email, secure and private cloud computing, and web security.",
"image" : "https://images.anytask.com/resources/user/07b908f2cd365eec/task/1604585232973_secure.png"},
{
"id":10 ,

"school": "Donald Bren School of Information and Computer Sciences",
"title": "Realistic Image Synthesis",
"course_level": "Graduate/Professional Only (200+)",

"description": "Provides an in-depth overview on a core sub-field of computer graphics. Graduate students who take this course are better prepared for conducting research on the related topics in computer graphics, vision, and scientific computing.",
"image" : "https://pbs.twimg.com/media/DVZtj_GUQAAv6mp.jpg"
},
{
"id": 11,

"school": "The Henry Samueli School of Engineering",
"title": "Introduction to Programming",
"course_level": "Lower Division (1-99)",
"description": "An introduction to computers and programming. Python programming syntax/style, types. Numbers and sequences. Control flow. I/O and errors/exceptions. Function calling, parameter passing, formal arguments, return values. Variable scoping. Programming laboratory.",
"image" : "https://www.tuni.fi/sites/default/files/styles/base_landscape_lg/public/media/image/jop_pow_koodaus.png?itok=MbIrLPrF"
},
{
"id": 12,
"school": "Donald Bren School of Information and Computer Sciences",
"title": "Project in Databases and Web Applications",
"course_level": "Upper Division (100-199)",

"description": "Introduces students to advanced database technologies and Web applications. Topics include database connectivity (ODBC/JDBC), extending databases using stored procedures, database administration, Web servers, Web programming languages (Java servlets, XML, Ajax, and mobile platforms).",
"image" : "https://www.midaswebtech.com/wp-content/themes/midas_it/images/web-development.gif"
}

]
1 change: 1 addition & 0 deletions recentquotes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"quoteText":"A lot of people give up just before theyre about to make it. You know you never know when that next obstacle is going to be the last one. ", "quoteAuthor":"Chuck Norris", "senderName":"", "senderLink":"", "quoteLink":"http://forismatic.com/en/2bc6cf0fd5/"}
1 change: 1 addition & 0 deletions src/main/java/com/example/init/InitApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class InitApplication {

public static void main(String[] args) {
SpringApplication.run(InitApplication.class, args);

}

}
30 changes: 30 additions & 0 deletions src/main/java/com/example/init/controllers/CourseController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.example.init.controllers;

import com.example.init.models.Courses;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.google.gson.stream.JsonReader;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.io.FileReader;
import java.lang.reflect.Type;
import java.util.List;

@Controller
public class CourseController {

@GetMapping("/courses")
public String getCourses(Model model) throws Exception {

Gson gson = new Gson();
JsonReader reader = new JsonReader(new FileReader(
"json.json"));
Type jsonCasting = new TypeToken<List<Courses>>() {
}.getType();
List<Courses> jsonList = gson.fromJson(reader, jsonCasting);
model.addAttribute("courses", jsonList);
return "courses";
}
}
36 changes: 36 additions & 0 deletions src/main/java/com/example/init/controllers/QuizController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.example.init.controllers;

import com.example.init.models.Quiz;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Type;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.List;

@Controller
public class QuizController {

@GetMapping("/quiz")
public String getQuiz(Model model) throws IOException {
Gson gson = new Gson();
String urlApi = "https://quizapi.io/api/v1/questions?apiKey=phkL2Z69NDCrImLlfnLoElQkoF3StoJlQrAeKvkf&limit=10&css";
HttpURLConnection connection = (HttpURLConnection) new URL(urlApi).openConnection();
InputStreamReader inputStreamReader = new InputStreamReader(connection.getInputStream());
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
String data = bufferedReader.readLine();
Type jsonCasting = new TypeToken<List<Quiz>>() {
}.getType();
List<Quiz> jsonList = gson.fromJson(data, jsonCasting);
model.addAttribute("quiz", jsonList);
bufferedReader.close();
return "quiz";
}
}
Loading