diff --git a/.gitignore b/.gitignore index 817f0f2..e067009 100644 --- a/.gitignore +++ b/.gitignore @@ -92,3 +92,10 @@ /Semester 3/Assignments/Templates01_CalebFontenot/target/ /Semester 3/Assignments/MaxTask/target/ /Semester 3/Assignments/MP1_Ajax/target/ +/Semester 3/Assignments/templates4_2/target/ +/Semester 3/Assignments/functions/build/ +/Semester 3/Assignments/functions/dist/ +/Semester 3/Assignments/AjaxReview/target/ +/Semester 3/Assignments/TermProject1_CalebFontenot/target/ +/Semester 3/Assignments/params/target/ +/Semester 3/Assignments/templatesMatricesSample/target/ diff --git a/Semester 3/Assignments/AjaxReview/nb-configuration.xml b/Semester 3/Assignments/AjaxReview/nb-configuration.xml new file mode 100644 index 0000000..f7b0362 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/nb-configuration.xml @@ -0,0 +1,21 @@ + + + + + + 10-web + gfv700ee10 + Facelets + JDK_15__System_ + + diff --git a/Semester 3/Assignments/AjaxReview/pom.xml b/Semester 3/Assignments/AjaxReview/pom.xml new file mode 100644 index 0000000..53f53fa --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/pom.xml @@ -0,0 +1,48 @@ + + 4.0.0 + asdv + AjaxReview + 1 + war + AjaxReview-1 + + + UTF-8 + 10.0.0 + + + + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee} + provided + + + org.primefaces + primefaces + 13.0.3 + jakarta + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + 11 + + + + org.apache.maven.plugins + maven-war-plugin + 3.3.2 + + + + \ No newline at end of file diff --git a/Semester 3/Assignments/AjaxReview/src/main/java/asdv/ajaxreview/JakartaRestConfiguration.java b/Semester 3/Assignments/AjaxReview/src/main/java/asdv/ajaxreview/JakartaRestConfiguration.java new file mode 100644 index 0000000..c2d1703 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/java/asdv/ajaxreview/JakartaRestConfiguration.java @@ -0,0 +1,13 @@ +package asdv.ajaxreview; + +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; + +/** + * Configures Jakarta RESTful Web Services for the application. + * @author Juneau + */ +@ApplicationPath("resources") +public class JakartaRestConfiguration extends Application { + +} diff --git a/Semester 3/Assignments/AjaxReview/src/main/java/asdv/ajaxreview/resources/JakartaEE10Resource.java b/Semester 3/Assignments/AjaxReview/src/main/java/asdv/ajaxreview/resources/JakartaEE10Resource.java new file mode 100644 index 0000000..5f27c81 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/java/asdv/ajaxreview/resources/JakartaEE10Resource.java @@ -0,0 +1,20 @@ +package asdv.ajaxreview.resources; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.Response; + +/** + * + * @author + */ +@Path("jakartaee10") +public class JakartaEE10Resource { + + @GET + public Response ping(){ + return Response + .ok("ping Jakarta EE") + .build(); + } +} diff --git a/Semester 3/Assignments/AjaxReview/src/main/java/beans/Ajax1.java b/Semester 3/Assignments/AjaxReview/src/main/java/beans/Ajax1.java new file mode 100644 index 0000000..d23ccf6 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/java/beans/Ajax1.java @@ -0,0 +1,40 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package beans; + +import jakarta.inject.Named; +import jakarta.enterprise.context.RequestScoped; + +/** + * + * @author asdv5 + */ +@Named(value = "ajax1") +@RequestScoped +public class Ajax1 +{ + private String input1; + private String input2; + + public String getInput1() + { + return input1; + } + + public void setInput1(String input1) + { + this.input1 = input1; + } + + public String getInput2() + { + return input2; + } + + public void setInput2(String input2) + { + this.input2 = input2; + } +} diff --git a/Semester 3/Assignments/AjaxReview/src/main/java/beans/Ajax2.java b/Semester 3/Assignments/AjaxReview/src/main/java/beans/Ajax2.java new file mode 100644 index 0000000..b9c2fda --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/java/beans/Ajax2.java @@ -0,0 +1,78 @@ +package beans; + +import jakarta.enterprise.context.RequestScoped; +import jakarta.faces.application.FacesMessage; +import jakarta.inject.Named; +import utilities.Utilities; + + +@Named(value = "ajax2") +@RequestScoped +public class Ajax2 +{ +private String farheneitTemperature; +private String celciusTemperature = "default value"; +private String testInput; +private String miles; + +public Ajax2() +{ + System.out.println("-----------------------------------------constructor Ajax2()"); +} +public String getTestInput() +{ + return this.testInput; +} +public void setTestInput( String testInput) +{ + System.out.println("testInput setter called"); + this.testInput = testInput; +} + + + public String getMiles() + { + return miles; + } + + public void setMiles(String miles) + { + System.out.println("miles: " + miles); + this.miles = miles; + } + + public String milesToKilometers() + { + if ( this.miles == null ) + return null; + double miles = Double.parseDouble( this.miles ); + double km = miles * 1.65; + return String.valueOf(km); + } + + + public String getFarheneitTemperature(){return farheneitTemperature;} + + public void setFarheneitTemperature(String farheneitTemperature) + { + System.out.println("setFarheneitTemperature: " + farheneitTemperature); + this.farheneitTemperature = farheneitTemperature; + this.celciusTemperature = convertFtoC(); + Utilities.addMessage(FacesMessage.SEVERITY_INFO, farheneitTemperature, celciusTemperature); + + } + public String getCelciusTemperature(){ + return celciusTemperature;} + private String convertFtoC() + { + double f = Double.parseDouble( this.farheneitTemperature ); + double c = (f - 32) * ( 5.0 / 9.0); + System.out.println("far: " + this.farheneitTemperature); + System.out.println("convert " + c); + celciusTemperature = String.valueOf(c); + return celciusTemperature; + } + + + +} diff --git a/Semester 3/Assignments/AjaxReview/src/main/java/beans/Ajax3.java b/Semester 3/Assignments/AjaxReview/src/main/java/beans/Ajax3.java new file mode 100644 index 0000000..0d517e4 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/java/beans/Ajax3.java @@ -0,0 +1,73 @@ +package beans; +import java.util.logging.Level; +import java.util.logging.Logger; +import jakarta.enterprise.context.RequestScoped; +import jakarta.inject.Named; + +@Named(value = "ajax3") +@RequestScoped +public class Ajax3 +{ + private static final Logger logger + = Logger.getLogger(Ajax3.class.getName()); + private String firstName = "default"; + private String lastName; + private String phone; + private String age; + private String address; +public Ajax3() +{ + logger.log(Level.INFO, "Ajax3 constructor called" ); +} + public String getFirstName() + { + + return firstName; + } + public void setFirstName(String firstName) + { + this.firstName = firstName; + } + public String getLastName() + { + return lastName; + } + public void setLastName(String lastName) + { + this.lastName = lastName; + } + public String getPhone() + { + return phone; + } + public void setPhone(String phone) + { + this.phone = phone; + } + public String getAge() + { + return age; + } + public void setAge(String age) + { + this.age = age; + } + public String getAddress() + { + return address; + } + public void setAddress(String address) + { + this.address = address; + } + public void ajaxAction(String executeNrender) + { + System.out.println(executeNrender); + logger.log(Level.INFO, "First Name = {0}", this.firstName); + logger.log(Level.INFO, "Last Name = {0}", this.lastName); + logger.log(Level.INFO, "Phone = {0}", this.phone); + logger.log(Level.INFO, "Age = {0}", this.age); + logger.log(Level.INFO, "Address = {0}", this.address); + System.out.println("--------------------------------------"); + } +} diff --git a/Semester 3/Assignments/AjaxReview/src/main/java/beans/Ajax5.java b/Semester 3/Assignments/AjaxReview/src/main/java/beans/Ajax5.java new file mode 100644 index 0000000..9d15706 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/java/beans/Ajax5.java @@ -0,0 +1,73 @@ + +package beans; + +import jakarta.inject.Named; +import jakarta.enterprise.context.SessionScoped; +import java.io.Serializable; +import jakarta.faces.application.FacesMessage; +import jakarta.faces.event.AbortProcessingException; +import jakarta.faces.event.AjaxBehaviorEvent; +import utilities.Utilities; + +@Named(value = "ajax5") +@SessionScoped +public class Ajax5 implements Serializable +{ + + private boolean buttonRed = false; + private String input; + + + public void mouseOverListener(AjaxBehaviorEvent event) + throws AbortProcessingException + { + System.out.println("mouseOverListener"); + setButtonRed(true); + Utilities.addMessage(FacesMessage.SEVERITY_INFO, "mouseOverListener", "red = true, input=" + input); + + } + + public void mouseOutListener(AjaxBehaviorEvent event) + throws AbortProcessingException + { + System.out.println("mouseOutListener"); + setButtonRed(false); + Utilities.addMessage(FacesMessage.SEVERITY_INFO, "mouseOutListener", "red = false, input=" + input); + + } + + public String getInput() + { + return input; + } + + public void setInput(String input) + { + this.input = input; + } + + + + + + + + + public boolean isButtonRed() + { + return buttonRed; + } + + public void setButtonRed(boolean buttonRed) + { + this.buttonRed = buttonRed; + } + + + public void actionMethod() + { + Utilities.addMessage(FacesMessage.SEVERITY_INFO, "actionMethod()", "input=" + input); + + } + +} diff --git a/Semester 3/Assignments/AjaxReview/src/main/java/beans/Ajax6.java b/Semester 3/Assignments/AjaxReview/src/main/java/beans/Ajax6.java new file mode 100644 index 0000000..5f6e990 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/java/beans/Ajax6.java @@ -0,0 +1,44 @@ +package beans; + +import jakarta.inject.Named; +import jakarta.enterprise.context.SessionScoped; +import java.io.Serializable; +import jakarta.faces.application.FacesMessage; +import jakarta.faces.event.AbortProcessingException; +import jakarta.faces.event.AjaxBehaviorEvent; +import utilities.Utilities; + +/** + * + * @author ASDV2 + */ +@Named(value = "ajax6") +@SessionScoped +public class Ajax6 implements Serializable +{ + private int brand = 0; + + public int getBrand() + { + return brand; + } + + public void setBrand(int brand) + { + this.brand = brand; + } + + + + public void clickListener(AjaxBehaviorEvent event) + throws AbortProcessingException + { + Utilities.addMessage(FacesMessage.SEVERITY_INFO, "clickListener", "brand= "+ brand); + } + public void changeListener(AjaxBehaviorEvent event) + throws AbortProcessingException + { + Utilities.addMessage(FacesMessage.SEVERITY_INFO, "changeListener", "brand= "+ brand); + } + +} diff --git a/Semester 3/Assignments/AjaxReview/src/main/java/beans/Ajax7.java b/Semester 3/Assignments/AjaxReview/src/main/java/beans/Ajax7.java new file mode 100644 index 0000000..a494c85 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/java/beans/Ajax7.java @@ -0,0 +1,60 @@ +package beans; + +import jakarta.enterprise.context.RequestScoped; +import jakarta.faces.application.FacesMessage; +import jakarta.inject.Named; +import utilities.Utilities; + + +@Named(value = "ajax7") +@RequestScoped +public class Ajax7 +{ +private String farheneitTemperature; +private String celciusTemperature; +private String miles; + + public String getMiles() + { + return miles; + } + + public void setMiles(String miles) + { + this.miles = miles; + } + + public String milesToKilometers() + { + if ( this.miles == null || "".equals(miles) ) + return null; + double miles = Double.parseDouble( this.miles ); + double km = miles * 1.65; + return String.valueOf(km); + } + + + public String getFarheneitTemperature(){return farheneitTemperature;} + + public void setFarheneitTemperature(String farheneitTemperature) + { + this.farheneitTemperature = farheneitTemperature; + this.celciusTemperature = convertFtoC(); + Utilities.addMessage(FacesMessage.SEVERITY_INFO, farheneitTemperature, celciusTemperature); + + } + public String getCelciusTemperature(){ + return celciusTemperature;} + private String convertFtoC() + { + if ( "".equals(this.farheneitTemperature ) ||farheneitTemperature == null ) + return ""; + double f = Double.parseDouble( this.farheneitTemperature ); + double c = (f - 32) * ( 5.0 / 9.0); + celciusTemperature = String.valueOf(c); + return celciusTemperature; + } + + + +} diff --git a/Semester 3/Assignments/AjaxReview/src/main/java/utilities/Utilities.java b/Semester 3/Assignments/AjaxReview/src/main/java/utilities/Utilities.java new file mode 100644 index 0000000..0e9efb2 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/java/utilities/Utilities.java @@ -0,0 +1,47 @@ +package utilities; + +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ + + +import jakarta.faces.application.FacesMessage; +import jakarta.faces.context.FacesContext; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Iterator; + +/** + * + * @author asdv5 + */ +public class Utilities +{ + public static String simpleDateFormat( Date date) + { + if ( date == null ) + return null; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd hh:mm"); + String s = sdf.format( date); + return s; + } + + public static void addMessage(FacesMessage.Severity severity, String summary, String detail) + { + FacesMessage msg = new FacesMessage(severity, summary, detail); + FacesContext.getCurrentInstance().addMessage(null, msg); + } + + public static void clearAllMessages() + { + FacesContext context = FacesContext.getCurrentInstance(); + Iterator it = context.getMessages(); + while (it.hasNext()) + { + it.next(); + it.remove(); + } + } + +} diff --git a/Semester 3/Assignments/AjaxReview/src/main/resources/META-INF/persistence.xml b/Semester 3/Assignments/AjaxReview/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..7582bf1 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Semester 3/Assignments/AjaxReview/src/main/webapp/WEB-INF/beans.xml b/Semester 3/Assignments/AjaxReview/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 0000000..9dfae34 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/Semester 3/Assignments/AjaxReview/src/main/webapp/WEB-INF/glassfish-web.xml b/Semester 3/Assignments/AjaxReview/src/main/webapp/WEB-INF/glassfish-web.xml new file mode 100644 index 0000000..673cc06 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/webapp/WEB-INF/glassfish-web.xml @@ -0,0 +1,25 @@ + + + + + + + + Keep a copy of the generated servlet class' java code. + + + diff --git a/Semester 3/Assignments/AjaxReview/src/main/webapp/WEB-INF/web.xml b/Semester 3/Assignments/AjaxReview/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..b35126a --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,56 @@ + + + + jakarta.faces.PROJECT_STAGE + Development + + + Faces Servlet + jakarta.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + + 30 + + + + faces/index.xhtml + + + + eot + application/vnd.ms-fontobject + + + + otf + font/opentype + + + + ttf + application/x-font-ttf + + + + woff + application/x-font-woff + + + + woff2 + application/x-font-woff2 + + + svg + image/svg+xml + + + + + diff --git a/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax1.xhtml b/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax1.xhtml new file mode 100644 index 0000000..6c98bb1 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax1.xhtml @@ -0,0 +1,37 @@ + + + + + ajax1 + + +

Ajax tag embedded

+

On event keyup we execute/process this and we render one ID

+ + + + + + + + + + + + + + + + + +
+ diff --git a/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax2.xhtml b/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax2.xhtml new file mode 100644 index 0000000..8ed9f46 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax2.xhtml @@ -0,0 +1,95 @@ + + + + + ajax2 + + + +

Ajax tag embedded -- Temperature Converter

+

event keyup reg-ex validation and multi-render with nested IDs. No need to specify IDs of parents

+ 1. The Ajax2 constructor is called once, even though we have 2 h:forms, upon rendering. ( see Glassfish Log and line 20 of Ajax2.java) +

+ 2. Upon entering numbers in h:form id="idForm1" at LINE 34, we execute the inputText and we render all + ids that exits within h:form id="idForm1". We cannot render IDs outside this form. + We CANNOT render outPutText id_nested_cField2 +

+ + 3. Upon entering numbers in h:form id="idForm2" at LINE 51, we execute the inputText and we render all + ids that exists within h:form id="idForm2". + We CAN render outputText id_nested_cField2 becuase it is in within the form idForm2. +

+ 4. Upon every number typed in inputText id="id_in1" of form id="idForm1" + the constructor of the bean is called , then its setter. The output to celcius and the grown are called when we render. +

+ 5. The nested ID= id_nested_cField2 can be accessed only from with form + id="idForm2" +

+ 6. The command button of id=id_cm2 only updates the upper form with id="idForm1", because it has ajax=true + while the command button id=id_cm2 updates both upper and lpwer form forms + + + + + + +
+ +
+ +
+ + + + + + + + +

nested Ids

+ +

+ + +

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

+ Temperature in Celsius: + + +

+ + +
+ +
+ + diff --git a/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax3.xhtml b/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax3.xhtml new file mode 100644 index 0000000..d91f422 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax3.xhtml @@ -0,0 +1,126 @@ + + + + + ajax3 + + + + 1. constructor of ajax3 bean called once upon rending +

+ 2. Test all cases one by one and see the outputs +
+ AJAX - execute=form a render=@form + + First Name + Last Name + Phone: + Age: + Address: + + + + + + + + + + + + + + +
+
+ AJAX - execute=@none , render=@form + + First Name: + Last Name: + Phone: + Age: + Address: + + + + + + + + + + + + +
+
+ AJAX - execute=@this render=@form + + First Name + Last Name + Phone: + Age: + Address: + + + +
+ + + + + + + + +
+
+
+ AJAX - identifiers + + First Name + Last Name + Phone: + Age: + Address: + + + +
+ + + + + + + + +
+
+
+ AJAX - execute=@all render=@all +
+ + First Name + Last Name + Phone: + Age: + Address: + + + +
+ + + + + + + + +
+ +
+ diff --git a/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax4.xhtml b/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax4.xhtml new file mode 100644 index 0000000..f1a7520 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax4.xhtml @@ -0,0 +1,123 @@ + + + + + ajax4 + + +
+ AJAX - process=form a update=@form + + First Name + Last Name + Phone: + Age: + Address: + + + + + + + + + + + + + + +
+
+ AJAX - process=@none , update=@form + + First Name: + Last Name: + Phone: + Age: + Address: + + + + + + + + + + + + +
+
+ AJAX - process=@this update=@form + + First Name + Last Name + Phone: + Age: + Address: + + + +
+ + + + + + + + +
+
+
+ AJAX - identifiers + + First Name + Last Name + Phone: + Age: + Address: + + + +
+ + + + + + + + +
+
+
+ AJAX - process=@all update=@all +
+ + First Name + Last Name + Phone: + Age: + Address: + + + +
+ + + + + + + + +
+ +
+ diff --git a/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax5.xhtml b/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax5.xhtml new file mode 100644 index 0000000..4335509 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax5.xhtml @@ -0,0 +1,36 @@ + + + + + ajax5 + + + 1.When an Ajax event triggers in the button, then it calls its listener AND the action method +

+ 2. In Order to send the form you must use f:ajax execute="@form" render="@form", line 25 +

+ + + + +
+ + + + + + +
+ +
+ + diff --git a/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax6.xhtml b/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax6.xhtml new file mode 100644 index 0000000..c301ce4 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax6.xhtml @@ -0,0 +1,42 @@ + + + + + ajax6 + + +

Valid event names you may use : blur, change, click, dblclick, focus, keydown, keypress, keyup, mousedown, mousemove, mouseout, mouseover, mouseup, valueChange.

+
+ 1. When it makes sense you can add events as needed and listeners for them. +

+ + + + + + + + + + + + + + + + + + + +
+ + diff --git a/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax7.xhtml b/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax7.xhtml new file mode 100644 index 0000000..8d24ca2 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/webapp/ajax7.xhtml @@ -0,0 +1,53 @@ + + + + + ajax7 + + +

1. Ajax tag as Wrapper, the keyup applies to all wrapped in it

+

2. Both inputs are validated and executed

+ + + + + + + + + +

+ + + + +
+ +

+ Temperature in Celsius: + +

+ +

+ Kilometers: + +

+ + +
+
+ + diff --git a/Semester 3/Assignments/AjaxReview/src/main/webapp/index.xhtml b/Semester 3/Assignments/AjaxReview/src/main/webapp/index.xhtml new file mode 100644 index 0000000..b34f1b6 --- /dev/null +++ b/Semester 3/Assignments/AjaxReview/src/main/webapp/index.xhtml @@ -0,0 +1,29 @@ + + + + + Ajax in button + + + + + + +

+ +

+ +

+ +

+ +

+ +

+ + +
+
+ diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/nb-configuration.xml b/Semester 3/Assignments/TermProject1_CalebFontenot/nb-configuration.xml new file mode 100644 index 0000000..39d0b87 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/nb-configuration.xml @@ -0,0 +1,21 @@ + + + + + + 10-web + gfv700ee10 + JDK_11__System_ + Facelets + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/pom.xml b/Semester 3/Assignments/TermProject1_CalebFontenot/pom.xml new file mode 100644 index 0000000..6570dbd --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/pom.xml @@ -0,0 +1,48 @@ + + 4.0.0 + edu.slcc.asdv.caleb + TermProject1_CalebFontenot + 1.0-SNAPSHOT + war + TermProject1_CalebFontenot-1.0-SNAPSHOT + + + UTF-8 + 10.0.0 + + + + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee} + provided + + + org.primefaces + primefaces + 13.0.5 + jakarta + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + 11 + + + + org.apache.maven.plugins + maven-war-plugin + 3.3.2 + + + + \ No newline at end of file diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/JakartaRestConfiguration.java b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/JakartaRestConfiguration.java new file mode 100644 index 0000000..b095b4f --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/JakartaRestConfiguration.java @@ -0,0 +1,13 @@ +package edu.slcc.asdv.caleb.termproject1_calebfontenot; + +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; + +/** + * Configures Jakarta RESTful Web Services for the application. + * @author Juneau + */ +@ApplicationPath("resources") +public class JakartaRestConfiguration extends Application { + +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/beans/MatrixBeanA.java b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/beans/MatrixBeanA.java new file mode 100644 index 0000000..69c989b --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/beans/MatrixBeanA.java @@ -0,0 +1,24 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package edu.slcc.asdv.caleb.termproject1_calebfontenot.beans; + +import jakarta.inject.Named; +import jakarta.faces.view.ViewScoped; +import java.io.Serializable; +import java.util.ArrayList; + +/** + * + * @author A. V. Markou + */ +@Named(value = "matrixBeanA") +@ViewScoped +public class MatrixBeanA implements Serializable +{ + + ArrayList> matrix = new ArrayList>(); + + +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/beans/MatrixBeanB.java b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/beans/MatrixBeanB.java new file mode 100644 index 0000000..696d221 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/beans/MatrixBeanB.java @@ -0,0 +1,26 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package edu.slcc.asdv.caleb.termproject1_calebfontenot.beans; + +import jakarta.inject.Named; +import jakarta.faces.view.ViewScoped; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import org.primefaces.PrimeFaces; + +/** + * + * @author A. V. Markou + */ +@Named(value = "matrixBeanB") +@ViewScoped +public class MatrixBeanB implements Serializable +{ + + ArrayList> matrix = new ArrayList>(); + + +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/beans/MatrixBeanC.java b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/beans/MatrixBeanC.java new file mode 100644 index 0000000..955bd86 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/beans/MatrixBeanC.java @@ -0,0 +1,24 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package edu.slcc.asdv.caleb.termproject1_calebfontenot.beans; + +import jakarta.inject.Named; +import jakarta.faces.view.ViewScoped; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; + +/** + * + * @author A. V. Markou + */ +@Named(value = "matrixBeanC") +@ViewScoped +public class MatrixBeanC implements Serializable +{ + + ArrayList> matrix = new ArrayList>(); + +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/beans/MatrixOperations.java b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/beans/MatrixOperations.java new file mode 100644 index 0000000..faa3cbf --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/beans/MatrixOperations.java @@ -0,0 +1,42 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package edu.slcc.asdv.caleb.termproject1_calebfontenot.beans; + +import jakarta.inject.Named; +import jakarta.faces.view.ViewScoped; +import jakarta.inject.Inject; +import java.io.Serializable; +import java.math.BigInteger; +import java.util.ArrayList; + +/** + * + * @author A. V. Markou + */ +@Named(value = "matrixOperations") +@ViewScoped +public class MatrixOperations implements Serializable +{ + + @Inject + MatrixBeanA matrixA; + @Inject + MatrixBeanB matrixB; + + @Inject + MatrixBeanC matrixC; + + public String add(){return "";} + + public String multiply(){return "";} + + + public MatrixBeanC getMatrixC(){return this.matrixC;} + + public MatrixBeanA getMatrixA(){return matrixA;} + + public MatrixBeanB getMatrixB(){return matrixB;} + +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/beans/MenuBar.java b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/beans/MenuBar.java new file mode 100644 index 0000000..99504fa --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/beans/MenuBar.java @@ -0,0 +1,64 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package edu.slcc.asdv.caleb.termproject1_calebfontenot.beans; + +import jakarta.faces.application.FacesMessage; +import jakarta.faces.application.FacesMessage.Severity; +import jakarta.faces.context.FacesContext; +import jakarta.inject.Named; +import jakarta.faces.view.ViewScoped; +import jakarta.inject.Inject; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.primefaces.PrimeFaces; + +@Named(value = "menuBar") +@ViewScoped +public class MenuBar implements Serializable +{ + @Inject + MatrixOperations matrixOperations; + private List> menus = new ArrayList>(); + + public void add() + { + System.out.println("Menu multiply was called"); + matrixOperations.multiply(); + List idsC = new ArrayList<>(); + idsC.add("formC"); + idsC.add("formC:datatableC"); + idsC.add("formC:datatableC:columnsC"); + idsC.add("formC:datatableC:columnsC:inputTextC"); + //idsC.add("form-menu");//:menuBar:submenu_matricies:menuitem_add"); + PrimeFaces.current().ajax().update(idsC); + } + + public void multiply() + { + message( + FacesMessage.SEVERITY_INFO, + "Not implemented.", "To be implemented." + ); + } + + public void subtract() + { + message( + FacesMessage.SEVERITY_INFO, + "Not implemented.", "To be implemented." + ); + } + + + + + + public void message(Severity severity, String msg, String msgDetails) + { + FacesMessage m = new FacesMessage(severity, msg, msgDetails); + FacesContext.getCurrentInstance().addMessage("msg", m); + } +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/bl/Matrices.java b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/bl/Matrices.java new file mode 100644 index 0000000..eb98e93 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/bl/Matrices.java @@ -0,0 +1,261 @@ +package edu.slcc.asdv.bl; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ForkJoinPool; +import java.util.concurrent.RecursiveTask; + +/** + * + * @author A. V. Markou + */ +public class Matrices implements Matrix +{ + + + @Override + public ArrayList> addParallel(ArrayList> A, ArrayList> B) + { + RecursiveTask>> rt + = new Matrices.MatricesAddition(0, A.size() - 1, A, B); + ForkJoinPool pool = new ForkJoinPool(); + ArrayList> result = pool.invoke(rt); + return result; + } + + @Override + public ArrayList> multiplyParallel(ArrayList> A, ArrayList> B) + { + RecursiveTask>> rt + = new Matrices.MatricesMultiplication(0, A.size() - 1, A, B); + ForkJoinPool pool = new ForkJoinPool(); + ArrayList> result = pool.invoke(rt); + return result; + } + + + + + + + static class MatricesAddition extends RecursiveTask>> + { + + ArrayList> A; + ArrayList> B; + ArrayList> AplusB; + final int HOW_MANY_ROWS_IN_PARALLEL = 100;//threshold + int startIndex; + int endIndex; + + public MatricesAddition(int startIndex, int endIndex, + ArrayList> A, + ArrayList> B) + { + this.startIndex = startIndex;//start at this row of the matrix + this.endIndex = endIndex;//end at this row of the matrix + this.A = A; + this.B = B; + AplusB = new ArrayList>(); + + } + + @Override + protected ArrayList> compute() + { + //>>This is the addition of matrices in the IF. + //That is, HOW_MANY_ROWS_IN_PARALLEL from matrix A and HOW_MANY_ROWS_IN_PARALLEL from matrix B + if (this.endIndex - this.startIndex < HOW_MANY_ROWS_IN_PARALLEL) + { + ArrayList> resultC = new ArrayList>(); + for (int i = this.startIndex; i <= this.endIndex; ++i) + { + //>create a new row to add it to the resulting matrix resultC + ArrayList rowAplusB = new ArrayList(); + + for (int j = 0; j < A.get(0).size(); j++) + + //>get the Ith row from A and the Ith row from B and + //and add all the Jth entries from each row + { + BigInteger x = A.get(i).get(j); + BigInteger y = B.get(i).get(j); + BigInteger z = x.add(y); + + rowAplusB.add(z); + } + resultC.add(rowAplusB); + } + return resultC; + } + else + { //>> keep on FORKING the matrix until the + //side of the matric is equal or less to HOW_MANY_ROWS_IN_PARALLEL + + int mid = (this.endIndex + this.startIndex) / 2; + RecursiveTask>> firstHalf + = new MatricesAddition(this.startIndex, mid, A, B); + + RecursiveTask>> secondHalf + = new MatricesAddition(mid + 1, this.endIndex, A, B); + + firstHalf.fork();//this line will invoke method compute + secondHalf.fork();///this line will invoke method compute + + //>> join what the FORKs returned from the IFs + AplusB.addAll(firstHalf.join()); + AplusB.addAll(secondHalf.join()); + + return AplusB; + } + } + + } + + /** + * Multiples two lists one 1-t01 correspondence, that is the 1st element of + * the first list is multiplied with 1st elements of the second list and so + * on + * + * @param list1 + * @param list2 + * @return the multiplied results + */ + public static ArrayList multiplyLists(ArrayList list1, ArrayList list2) + { + ArrayList resultsOfMultiplications = new ArrayList(); + for (int bi = 0; bi < list1.size(); + ++bi) + { + resultsOfMultiplications.add(list1.get(bi).multiply(list2.get(bi))); + } + return resultsOfMultiplications; + } + + public static ArrayList> columnMajorOrderReversal(ArrayList> b) + { + ArrayList> tranformed = new ArrayList>(); + for (int column = 0; + column < b.get(0).size(); + ++column) + { + ArrayList rowTrandormedToColmn = new ArrayList(); + for (int row = 0; + row < b.size(); + ++row) + { + BigInteger bd = b.get(row).get(column); + rowTrandormedToColmn.add(bd); + } + tranformed.add(rowTrandormedToColmn); + } + + return tranformed; + } + + /** + * Adds a list of Big Decimals and returns the result of the addition. + * + * @param list - list of BigDecimal type + * @return the sum of the list + */ + public static BigInteger add(ArrayList list) + { + BigInteger bd = BigInteger.ZERO; + for (int bi = 0; bi < list.size(); + bi++) + { + bd = bd.add(list.get(bi)); + } + return bd; + } + + static class MatricesMultiplication extends RecursiveTask>> + { + + ArrayList> A; + ArrayList> B; + ArrayList> AxB; + final int HOW_MANY_ROWS_IN_PARALLEL = 3;//threshold + int startIndex; + int endIndex; + + public MatricesMultiplication(int startIndex, int endIndex, + ArrayList> A, + ArrayList> B) + { + this.startIndex = startIndex;//start at this row of the matrix + this.endIndex = endIndex;//end at this row of the matrix + this.A = A; + this.B = B; + AxB = new ArrayList>(); + + } + + /** + * matrix 1, 2, 3 4, 5, 6 + * + * will be transformed to 1, 4 2, 5 3, 6 + * + * @param list + * @return + */ + @Override + protected ArrayList> compute() + { + //>>This is the addition of matrices in the IF. + //That is, HOW_MANY_ROWS_IN_PARALLEL from matrix A and HOW_MANY_ROWS_IN_PARALLEL from matrix B + if (this.endIndex - this.startIndex < HOW_MANY_ROWS_IN_PARALLEL) + { + ArrayList> resultC = new ArrayList>(); + ArrayList> bTransformed = columnMajorOrderReversal(B); + + for (int biA = this.startIndex; + biA <= this.endIndex; + ++biA) + { + ArrayList rowA = A.get(biA); + ArrayList rowAxB = new ArrayList(); + ArrayList rowCalculation = new ArrayList(); + for (int biB = 0; + biB < bTransformed.size(); + ++biB) + { + ArrayList rowB = bTransformed.get(biB); + + ArrayList productsOfRow = multiplyLists(rowA, rowB); + BigInteger sumOfRow = add(productsOfRow); + rowCalculation.add(sumOfRow); + + } + resultC.add(rowCalculation); + + } + return resultC; + } + else + { //>> keep on FORKING the matrix until the + //side of the matric is equal or less to HOW_MANY_ROWS_IN_PARALLEL + + int mid = (this.startIndex + this.endIndex) / 2; + RecursiveTask>> firstHalf + = new MatricesMultiplication(this.startIndex, mid, A, B); + + RecursiveTask>> secondHalf + = new MatricesMultiplication(mid + 1, this.endIndex, A, B); + + firstHalf.fork();//this line will invoke method compute + secondHalf.fork();///this line will invoke method compute + + //>> join what the FORKs returned from the IFs + AxB.addAll(firstHalf.join()); + AxB.addAll(secondHalf.join()); + + return AxB; + } + } + + } + +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/bl/Matrix.java b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/bl/Matrix.java new file mode 100644 index 0000000..fd06101 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/bl/Matrix.java @@ -0,0 +1,19 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Interface.java to edit this template + */ +package edu.slcc.asdv.bl; + +import java.math.BigInteger; +import java.util.ArrayList; + +/** + * + * @author ASDV1 + */ +public interface Matrix +{ + ArrayList> addParallel(ArrayList> A, ArrayList> B); + ArrayList> multiplyParallel(ArrayList> A, ArrayList> B); + +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/resources/JakartaEE10Resource.java b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/resources/JakartaEE10Resource.java new file mode 100644 index 0000000..8cef555 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/resources/JakartaEE10Resource.java @@ -0,0 +1,20 @@ +package edu.slcc.asdv.caleb.termproject1_calebfontenot.resources; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.Response; + +/** + * + * @author + */ +@Path("jakartaee10") +public class JakartaEE10Resource { + + @GET + public Response ping(){ + return Response + .ok("ping Jakarta EE") + .build(); + } +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/utilities/Utilities.java b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/utilities/Utilities.java new file mode 100644 index 0000000..bbb2b11 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/java/edu/slcc/asdv/caleb/termproject1_calebfontenot/utilities/Utilities.java @@ -0,0 +1,123 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.caleb.termproject1_calebfontenot.utilities; + + +import jakarta.el.ELContext; +import jakarta.el.ELResolver; +import jakarta.faces.application.Application; +import jakarta.faces.application.FacesMessage; +import jakarta.faces.component.UIComponent; +import jakarta.faces.context.FacesContext; +import java.math.BigInteger; +import java.util.ArrayList; + + +public class Utilities +{ + + public static UIComponent findComponent(String id) + { + + UIComponent result = null; + UIComponent root = FacesContext.getCurrentInstance().getViewRoot(); + if (root != null) + { + result = findComponent(root, id); + } + return result; + + } + + public static UIComponent findComponent(UIComponent root, String id) + { + + UIComponent result = null; + if (root.getId().equals(id)) + { + return root; + } + + for (UIComponent child : root.getChildren()) + { + if (child.getId().equals(id)) + { + result = child; + break; + } + result = findComponent(child, id); + if (result != null) + { + break; + } + } + return result; + + } + + public static void printIDs(UIComponent component) + { + System.out.println("\n\nPARENT ID " + component.getId()); + + if (component.getChildren() == null) + { + return; + } + + for (UIComponent child : component.getChildren()) + { + System.out.println("\t\tCHILD ID " + child.getId()); + + printIDs(child); + + } + } + +public static boolean isNumberOrDecimal( String s ) +{ + System.out.println("isNumberOrDecimal called " + s); + //[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+) + String regx = "^[+-]?(\\d*\\.)?\\d+$"; + return s.matches(regx); + +} + public static void message( FacesMessage.Severity severity, String msg, String msgDetails) + { + FacesMessage m = new FacesMessage(severity, msg, msgDetails); + FacesContext.getCurrentInstance().addMessage("msg", m); + } + + + public static T getCDIBean(String nameOfTheBean) + { + ELContext elc = FacesContext.getCurrentInstance().getELContext(); + FacesContext fc = FacesContext.getCurrentInstance(); + Application ap = fc.getApplication(); + ELResolver elr = ap.getELResolver(); + return (T) elr.getValue(elc, null, nameOfTheBean); + } + + + public static ArrayList> convertBigIntegerToString(ArrayList> matrix) + { + ArrayList> stringMatrix = new ArrayList>(); + + for (ArrayList row : matrix) + { + ArrayList stringRow = new ArrayList(); + for (BigInteger bigInt : row) + { + stringRow.add(new String(bigInt.toString())); + + } + stringMatrix.add(stringRow); + } + return stringMatrix; + } + + + + +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/resources/META-INF/persistence.xml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..7582bf1 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/WEB-INF/beans.xml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 0000000..9dfae34 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/WEB-INF/glassfish-web.xml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/WEB-INF/glassfish-web.xml new file mode 100644 index 0000000..673cc06 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/WEB-INF/glassfish-web.xml @@ -0,0 +1,25 @@ + + + + + + + + Keep a copy of the generated servlet class' java code. + + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/WEB-INF/web.xml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..fcfcd54 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,24 @@ + + + + jakarta.faces.PROJECT_STAGE + Development + + + Faces Servlet + jakarta.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + + 30 + + + + faces/index.xhtml + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/index.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/index.xhtml new file mode 100644 index 0000000..3018965 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/index.xhtml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + Application Software Development, SLCC + + + + Templates, and Menus Illustration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ASDV 2800 , Templates + + +
+
+ + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/login-n-search/login.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/login-n-search/login.xhtml new file mode 100644 index 0000000..e5b3f6c --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/login-n-search/login.xhtml @@ -0,0 +1,25 @@ + + + + + Login + > + + + + + + + + + + + + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/login-n-search/search.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/login-n-search/search.xhtml new file mode 100644 index 0000000..21586b9 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/login-n-search/search.xhtml @@ -0,0 +1,21 @@ + + + + + Login + > + + + + + + + + + + + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/matrices/compose.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/matrices/compose.xhtml new file mode 100644 index 0000000..900ea85 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/matrices/compose.xhtml @@ -0,0 +1,26 @@ + + + + + Facelet Title + + + + + + + + + + + + + + + + + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/matrices/matrixA.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/matrices/matrixA.xhtml new file mode 100644 index 0000000..59cb4a9 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/matrices/matrixA.xhtml @@ -0,0 +1,24 @@ + + + + + MatriX A + + + + + + + + + +

Matrix A

+

DataTable of dynamically created of input-texts

+ +
+
+ + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/matrices/matrixB.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/matrices/matrixB.xhtml new file mode 100644 index 0000000..381d7ef --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/matrices/matrixB.xhtml @@ -0,0 +1,18 @@ + + + + + MatriX A + + + + +

Matrix B

+

DataTable of dynamically created of input-texts

+
+
+ + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/matrices/matrixC.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/matrices/matrixC.xhtml new file mode 100644 index 0000000..40e89d4 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/matrices/matrixC.xhtml @@ -0,0 +1,18 @@ + + + + + MAtrix C + + + + +

Matrix C = A menu-operation B

+
+ +
+ + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/matrices/menuActivities.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/matrices/menuActivities.xhtml new file mode 100644 index 0000000..c3363b5 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/matrices/menuActivities.xhtml @@ -0,0 +1,29 @@ + + + + + Menu Matricies + + + + + + + + + + + + + + + + + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/matrices/menuMatrices.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/matrices/menuMatrices.xhtml new file mode 100644 index 0000000..b5229db --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/matrices/menuMatrices.xhtml @@ -0,0 +1,39 @@ + + + + + Menu + + + + + + + + + + + + + + + + + + + + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/bottomStyle.css b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/bottomStyle.css new file mode 100644 index 0000000..eeca699 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/bottomStyle.css @@ -0,0 +1,18 @@ +#bottom { + margin: 0px 0px 0px 0px; + text-align:center; + color: #ffffff; + + background-image: -webkit-gradient( + linear, + left top, + left bottom, + color-stop(0, blue), + color-stop(1, blue) + ); + background-image: -o-linear-gradient(bottom, blue 0%, #120205 100%); + background-image: -moz-linear-gradient(bottom, blue 0%, #120205 100%); + background-image: -webkit-linear-gradient(bottom, blue 0%, #120205 100%); + background-image: -ms-linear-gradient(bottom, blue 0%, #120205 100%); + background-image: linear-gradient(to bottom, blue 0%, #120205 100%); +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/contentStyle.css b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/contentStyle.css new file mode 100644 index 0000000..f505a90 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/contentStyle.css @@ -0,0 +1,3 @@ +#content { + background: white; +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/cssLayout.css b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/cssLayout.css new file mode 100644 index 0000000..4b6e5ff --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/cssLayout.css @@ -0,0 +1,50 @@ +#wrapper { + margin-left:auto; + margin-right:auto; +} + +#title { + position: relative; + margin: 1px 0px 0px 0px; +} + +#login_and_search { + position: relative; + margin: 0px 0px 5px 0px; +} + +#login { + float: left; + position: relative; +} + +#search { + float: right; + position: relative; +} + +#top { + position: relative; + overflow: hidden; +} + +#bottom { + position: relative; +} + +#left { + float: left; +} + +#logo { + float: left; +} + +#right { + float: right; +} + +#content { + overflow: hidden; +} + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/dataTable.css b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/dataTable.css new file mode 100644 index 0000000..8b0bacf --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/dataTable.css @@ -0,0 +1,237 @@ + +.rowNumber{ + + margin-right:20px; + width : 100px; + background: blue; + font-family: Impact; + font-size: 1.2em; + color: white; +} + +body .ui-datatable .ui-paginator { + position: relative; + text-align: left; + bottom: 0px; + width: inherit; + padding: 2px; + z-index: 1; +} + + +.input { + font-size: 1em; + max-width: 35px; + min-width: 35px; + height : 35px; + font-size: 1em; + font-family: inherit; + background-color: #fff; + border: solid 1px; + + border-color: blueviolet; + border-radius: 4px; +} + +.dataTables { + overflow-y:scroll; + overflow-x:scroll; + + + height : 386px; + width: 300px; + display:block; + background-color: #fff; + + zoom: 1; +} + +.ui-datatable table{ + border-collapse:collapse; + width:100%; +} +.ui-datatable.ui-datatable-header,.ui-datatable.ui-datatable-footer{ + text-align:center; + padding:4px 10px; + +} +.ui-datatable.ui-datatable-header{ + border-bottom:0px none; + +} +.ui-datatable.ui-datatable-footer{ + border-top:0px none; +} +.ui-datatable thead th +{ + font-family: Arial; + font-size: 1.2em; + color: blue; + background: white; +} +.ui-datatable thead td +{ + font-family: Impact; + font-size:1.2em; + color: blue; +} +.ui-datatable tfoot td{ + text-align:center; +} +ui-datatable thead th +{ + overflow:hidden; +} +.ui-datatable tbody td , .ui-datatable tfoot td{ + padding:4px 10px; + overflow:hidden; + white-space:nowrap; + border-width:1px; + border-style:solid; +} +.ui-datatable tbody tr +{ + clear: both; +} + +.ui-datatable .ui-sortable-column{ + cursor:pointer; +} +.ui-datatable div.ui-dt-c{ + position:relative; +} +.ui-datatable .ui-sortable-column-icon{ + display:inline-block; + margin:-3px 0px -3px 2px; +} +.ui-datatable .ui-column-filter{ + display:block; + width:100px; + margin:auto; +} +.ui-datatable .ui-expanded-row{ + border-bottom:0px none; +} +.ui-datatable .ui-expanded-row-content{ + border-top:0px none; +} +.ui-datatable .ui-row-toggler{ + cursor:pointer; +} +.ui-datatable tr.ui-state-highlight{ + cursor:pointer; +} +.ui-datatable .ui-selection-column .ui-chkbox-all{ + display:block; + margin:0px auto; + width:16px; + height:16px; +} +.ui-datatable-scrollable table{ + table-layout:auto; +} +.ui-datatable-scrollable-body{ + overflow:auto; +} +.ui-datatable-scrollable-header,.ui-datatable-scrollable-footer{ + overflow:hidden; + border:0px none; +} +.ui-datatable-scrollable .ui-datatable-scrollable-header,.ui-datatable-scrollable .ui-datatable-scrollable-footer{ + position:relative; +} +.ui-datatable-scrollable .ui-datatable-scrollable-header td{ + font-weight:normal; +} +.ui-datatable-scrollable-body::-webkit-scrollbar{ + -webkit-appearance:none; + width:15px; + background-color:transparent; +} +.ui-datatable-scrollable-body::-webkit-scrollbar-thumb{ + border-radius:8px; + border:1px solid white; + background-color:rgba(194,194,194,.5); +} +.ui-datatable .ui-datatable-data tr.ui-state-hover{ + border-color:inherit; + font-weight:inherit; + cursor:pointer; +} +.ui-datatable .ui-paginator,.ui-datatable .ui-paginator{ + padding:2px; +} +.ui-column-dnd-top, ui-column-dnd-bottom{ + display:none; + position:absolute; +} +.ui-column-dnd-top .ui-icon, ui-column-dnd-bottom .ui-icon{ + position:absolute; + top:-4px; +} +/* InCell Editing */.ui-datatable .ui-cell-editor-input{ + display:none; +} +.ui-datatable .ui-row-editing .ui-cell-editor .ui-cell-editor-output{ + display:none; +} +.ui-datatable .ui-row-editing .ui-cell-editor .ui-cell-editor-input{ + display:block; +} +.ui-datatable .ui-row-editor span{ + cursor:pointer; + display:inline-block; +} +.ui-datatable .ui-row-editor .ui-icon-pencil{ + display:inline-block; +} +.ui-datatable .ui-row-editing .ui-row-editor .ui-icon-pencil{ + display:none; +} +.ui-datatable .ui-row-editor .ui-icon-check,.ui-datatable .ui-row-editor .ui-icon-close{ + display:none; +} +.ui-datatable .ui-row-editing .ui-row-editor .ui-icon-check,.ui-datatable .ui-row-editing .ui-row-editor .ui-icon-close{ + display:inline-block; +} +.ui-datatable .ui-datatable-data tr.ui-row-editing td.ui-editable-column,.ui-datatable .ui-datatable-data td.ui-cell-editing{ + padding:0; + margin:0; +} +/*resizer */.ui-datatable .ui-column-resizer{ + width:8px; + height:20px; + padding:0px; + cursor:col-resize; + background-image:url("/ScraperOnWeb/javax.faces.resource/spacer/dot_clear.gif.jsf?ln=primefaces"); + margin:-4px -10px -4px 0px; + float:right; +} +.ui-datatable .ui-filter-column .ui-column-resizer{ + height:45px; +} +.ui-datatable .ui-column-resizer-helper{ + width:1px; + position:absolute; + z-index:10; + display:none; +} +.ui-datatable-resizable{ + padding-bottom:1px;/*fix for webkit overlow*/ + overflow:auto; +} +.ui-datatable-resizable table{ + table-layout:auto; +} +.ui-datatable-rtl{ + direction:rtl; +} +.ui-datatable-rtl.ui-datatable thead th, .ui-datatable-rtl.ui-datatable tfoot td{ + text-align:right; +} + + + + + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/default.css b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/default.css new file mode 100644 index 0000000..0c5e67f --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/default.css @@ -0,0 +1,8 @@ + +body { + background-color: #ffffff; + font-size: 12px; + font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + color: #000000; + margin: 2px; +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/imageZoomStyle.css b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/imageZoomStyle.css new file mode 100644 index 0000000..8aa00a0 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/imageZoomStyle.css @@ -0,0 +1,34 @@ + +* {box-sizing: border-box;} + +.img-zoom-container { + position: relative; +} + +.img-zoom-lens { + position: absolute; + /*set the size of the lens:*/ + width: 40px; + height: 40px; +} + +.img-zoom-result { + + /*border: 5px solid #000000;*/ + /*set the size of the result div:*/ + width: 300px; + height: 300px; +} +.myDiv +{ + align: center; + padding: 30px; + margin: 10; + border-left: 10px solid navy; +} + +.hpanel{ + position: relative; + top: 0px; left: 0px; +} + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/leftStyle.css b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/leftStyle.css new file mode 100644 index 0000000..aaafa7d --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/leftStyle.css @@ -0,0 +1,22 @@ +#left { + + background-image: -webkit-gradient( + linear, + left top, + left bottom, + color-stop(0, #2D4A37), + color-stop(1, #789480) + ); + background-image: -o-linear-gradient(bottom, #2D4A37 0%, #789480 100%); + background-image: -moz-linear-gradient(bottom, #2D4A37 0%, #789480 100%); + background-image: -webkit-linear-gradient(bottom, #2D4A37 0%, #789480 100%); + background-image: -ms-linear-gradient(bottom, #2D4A37 0%, #789480 100%); + background-image: linear-gradient(to bottom, #2D4A37 0%, #789480 100%); + -moz-box-shadow: 0px 0px 15px 3px #333333; + -webkit-box-shadow: 0px 0px 15px 3px #333333; + box-shadow: 0px 0px 15px 3px #333333; + + text-align:left; + padding-left:10px; + margin-right: 5px; +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/loginStyle.css b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/loginStyle.css new file mode 100644 index 0000000..2849107 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/loginStyle.css @@ -0,0 +1,65 @@ +.inputs { + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + background-color: #00f; + background: -moz-linear-gradient(top, #FFF, #EAEAEA); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0.0, #FFF), color-stop(1.0, #EAEAEA)); + border: 1px solid #CACACA; + color: #444; + font-size: 1.1em; + margin: 0px 10px 0px 0px; + padding-left: 2px; + width:200px; +} +.inputs:focus { + color: #ffffff; + background: #0000cc; + -webkit-box-shadow: 0 0 25px #CCC; + -moz-box-shadow: 0 0 25px #cccc00; + box-shadow: 0 0 25px #CCCC00; + -webkit-transform: scale(1.05); + -moz-transform: scale(1.05); + transform: scale(1.05); +} + +.lbutton { + -moz-box-shadow: 4px 7px 13px -7px #276873; + -webkit-box-shadow: 4px 7px 13px -7px #276873; + box-shadow: 4px 7px 13px -7px #276873; + background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #171717), color-stop(1, #d92323)); + background:-moz-linear-gradient(top, #171717 5%, #222 100%); + background:-webkit-linear-gradient(top, #171717 5%, #222 100%); + background:-o-linear-gradient(top, #171717 5%, #222 100%); + background:-ms-linear-gradient(top, #171717 5%, #222 100%); + background:linear-gradient(to bottom, #171717 5%, #222 100%); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#171717', endColorstr='#d92323',GradientType=0); + background-color:#222; + -moz-border-radius:17px; + -webkit-border-radius:17px; + border-radius:17px; + display:inline-block; + cursor:pointer; + color:#ffffff; + font-family:arial; + font-size:12px; + font-weight:bold; + padding:2px 12px; + text-decoration:none; + text-shadow:0px 1px 0px #3d768a; +} +.lbutton:hover { + background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #222), color-stop(1, #171717)); + background:-moz-linear-gradient(top, #00f 5%, #222 100%); + background:-webkit-linear-gradient(top, 00f 5%, #222 100%); + background:-o-linear-gradient(top, #00f 5%, #222 100%); + background:-ms-linear-gradient(top, #00f 5%, #222 100%); + background:linear-gradient(to bottom, #00f 5%, #222 100%); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#d92323', endColorstr='#222',GradientType=0); + background-color:#00f; +} +.lbutton:active { + position:relative; + top:1px; +} + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/login_and_searchStyle.css b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/login_and_searchStyle.css new file mode 100644 index 0000000..b35091d --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/login_and_searchStyle.css @@ -0,0 +1,8 @@ +#login_and_search { + + width:100%; + height:90px; + background-color: white; + padding: 20px; + display: inline-block; +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/logoStyle.css b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/logoStyle.css new file mode 100644 index 0000000..83870d2 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/logoStyle.css @@ -0,0 +1,9 @@ +#logo { + background-image : url("#{resource['images/owl.png']}") ; + background-repeat: no-repeat; + margin-right: 0px; + width:60px; + height:60px; + float: left; + +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/menuStyle.css b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/menuStyle.css new file mode 100644 index 0000000..a68d788 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/menuStyle.css @@ -0,0 +1,37 @@ +#menu { + white-space: nowrap; + height: 28px; + width:100%; + background: #fff url("#{resource['images/menu.png']}") bottom center ; + margin-bottom: 5px; +} + +#menu ul { + margin: 0; + padding: 0; + list-style:none; + float:left; +} + +#menu li { + float: left; + margin: 0 3px 0 3px; + padding: 0; + background: transparent; +} + +#menu a { + font-family: Arial, Helvetica, sans-serif; + font-size: 15px; + font-weight: normal; + float:left; + display:block; + height: 26px; + line-height: 24px; + padding: 2px 10px 0 10px; + color: #cccc00; + text-decoration: none; + background: transparent; + +} + \ No newline at end of file diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/rightStyle.css b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/rightStyle.css new file mode 100644 index 0000000..4c5502a --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/rightStyle.css @@ -0,0 +1,5 @@ +#right { + background-color: #FA0519; + text-align:center; + margin-left: 5px; +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/searchStyle.css b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/searchStyle.css new file mode 100644 index 0000000..57e52f1 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/searchStyle.css @@ -0,0 +1,3 @@ +#search { + color: #ffffff; +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/stylesLinks.css b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/stylesLinks.css new file mode 100644 index 0000000..eef30a3 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/stylesLinks.css @@ -0,0 +1,67 @@ + +a { + font-family: Arial, Helvetica, sans-serif; + font-size: 15px; + font-weight: normal; + float:left; + display:block; + height: 26px; + line-height: 24px; + padding: 2px 10px 0 10px; + color: #cccc00; + text-decoration:#A3979A; + background-color: white; + border: white; + padding: 0px +} +a.hover { + float: left; + font-family: Arial, Helvetica, sans-serif; + font-size: 15px; + font-weight: normal; + float:left; + display:block; + height: 26px; + line-height: 24px; + color: #cccc00; + text-decoration: none; + + background-color: white; + border: white; + padding: 0px +} + +.menus +{ + font-family: Arial, Helvetica, sans-serif; + font-size: 15px; + font-weight: normal; + float:right; + + + color: #cccc00; + text-decoration:#A3979A; + background-color: white; + border: white; + padding: 0px ; + margin-top: 0px; + margin-right: 0px; + margin-bottom: 0px; + margin-left: 0px; +} + + .affaires .ui-menuitem-text{color:#cccc00; + decoration: bold, italic; + + } + .affaires .ui-menu-child{background: white; mouseover: #000; + background-color: #A80000;} + .affaires .ui-menubar{mouseover: #000; + background-color: #A80000;} + .affaires .ui-state-hover {} + + a.active { + color: #D09d23; + font-weight: bold; + background-color : #c7c3c3; +} \ No newline at end of file diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/titleStyle.css b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/titleStyle.css new file mode 100644 index 0000000..24b1112 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/titleStyle.css @@ -0,0 +1,9 @@ +#title { + background: white; + color:blue; + text-align:center; + font-size: 24px; + font-weight: bold; +} + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/topStyle.css b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/topStyle.css new file mode 100644 index 0000000..63294a9 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/css/layout-css/topStyle.css @@ -0,0 +1,9 @@ +#top { + color: blue; + font-family: cursive, sans-serif; + font-size: 22px; + font-style: italic; + text-align: center; + height:60px; + background: white; +} diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/images/download.png b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/images/download.png new file mode 100644 index 0000000..b1315ca Binary files /dev/null and b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/images/download.png differ diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/images/owl.png b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/images/owl.png new file mode 100644 index 0000000..84fb6d0 Binary files /dev/null and b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/images/owl.png differ diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/js/do_validation.js b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/js/do_validation.js new file mode 100644 index 0000000..6e21513 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/js/do_validation.js @@ -0,0 +1,22 @@ + + + +function validateText(textInputID) +{ + var htmlInputText = document.getElementById(textInputID); + var text = htmlInputText.value; + + + var regex = /[^A-Za-z0-9]/g; + + if (text.search( regex) != -1) + { + newText = text.replace(regex, ""); + htmlInputText.value = newText; + //alert("alphanumeric chars only please"); + + } + +} + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/bottomDefault.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/bottomDefault.xhtml new file mode 100644 index 0000000..1925805 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/bottomDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + +

This is default footer

+
+
+ diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/contentDefault.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/contentDefault.xhtml new file mode 100644 index 0000000..81c4495 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/contentDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + This is default content + + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/leftDefault.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/leftDefault.xhtml new file mode 100644 index 0000000..1e7e628 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/leftDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + This is default left side + + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/loginDefault.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/loginDefault.xhtml new file mode 100644 index 0000000..b1dd7a8 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/loginDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + Default Login Section + + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/logoDefault.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/logoDefault.xhtml new file mode 100644 index 0000000..54103c8 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/logoDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + LOGO + + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/menuDefault.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/menuDefault.xhtml new file mode 100644 index 0000000..f244225 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/menuDefault.xhtml @@ -0,0 +1,14 @@ + + + + + + + Menu default + + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/rightDefault.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/rightDefault.xhtml new file mode 100644 index 0000000..9aabcc8 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/rightDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + This is default right side + + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/searchDefault.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/searchDefault.xhtml new file mode 100644 index 0000000..80b6c4b --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/searchDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + Default Search Section + + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/titleDefault.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/titleDefault.xhtml new file mode 100644 index 0000000..7c9eeb4 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/titleDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + This is default title + + + diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/topDefault.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/topDefault.xhtml new file mode 100644 index 0000000..f1b76a0 --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/default/topDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + +

This is default header

+
+
+ diff --git a/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/generic/generic-layout.xhtml b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/generic/generic-layout.xhtml new file mode 100644 index 0000000..39934fa --- /dev/null +++ b/Semester 3/Assignments/TermProject1_CalebFontenot/src/main/webapp/resources/templates/generic/generic-layout.xhtml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + Generic Template + + +
+ +
+ + + +
+
+ +
+ + + +
+ + + +
+
+
+ + + + + + + + + +
+ + +
+ + + +
+
+ + + + + +
+ + + +
+
+ + +
+ +
+ + + +
+
+
+
+ diff --git a/Semester 3/Assignments/functions/.dep.inc b/Semester 3/Assignments/functions/.dep.inc new file mode 100644 index 0000000..38ba445 --- /dev/null +++ b/Semester 3/Assignments/functions/.dep.inc @@ -0,0 +1,5 @@ +# This code depends on make tool being used +DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES} ${TESTOBJECTFILES})) +ifneq (${DEPFILES},) +include ${DEPFILES} +endif diff --git a/Semester 3/Assignments/functions/Makefile b/Semester 3/Assignments/functions/Makefile new file mode 100644 index 0000000..05de621 --- /dev/null +++ b/Semester 3/Assignments/functions/Makefile @@ -0,0 +1,128 @@ +# +# There exist several targets which are by default empty and which can be +# used for execution of your targets. These targets are usually executed +# before and after some main targets. They are: +# +# .build-pre: called before 'build' target +# .build-post: called after 'build' target +# .clean-pre: called before 'clean' target +# .clean-post: called after 'clean' target +# .clobber-pre: called before 'clobber' target +# .clobber-post: called after 'clobber' target +# .all-pre: called before 'all' target +# .all-post: called after 'all' target +# .help-pre: called before 'help' target +# .help-post: called after 'help' target +# +# Targets beginning with '.' are not intended to be called on their own. +# +# Main targets can be executed directly, and they are: +# +# build build a specific configuration +# clean remove built files from a configuration +# clobber remove all built files +# all build all configurations +# help print help mesage +# +# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and +# .help-impl are implemented in nbproject/makefile-impl.mk. +# +# Available make variables: +# +# CND_BASEDIR base directory for relative paths +# CND_DISTDIR default top distribution directory (build artifacts) +# CND_BUILDDIR default top build directory (object files, ...) +# CONF name of current configuration +# CND_PLATFORM_${CONF} platform name (current configuration) +# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration) +# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration) +# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration) +# CND_PACKAGE_DIR_${CONF} directory of package (current configuration) +# CND_PACKAGE_NAME_${CONF} name of package (current configuration) +# CND_PACKAGE_PATH_${CONF} path to package (current configuration) +# +# NOCDDL + + +# Environment +MKDIR=mkdir +CP=cp +CCADMIN=CCadmin + + +# build +build: .build-post + +.build-pre: +# Add your pre 'build' code here... + +.build-post: .build-impl +# Add your post 'build' code here... + + +# clean +clean: .clean-post + +.clean-pre: +# Add your pre 'clean' code here... + +.clean-post: .clean-impl +# Add your post 'clean' code here... + + +# clobber +clobber: .clobber-post + +.clobber-pre: +# Add your pre 'clobber' code here... + +.clobber-post: .clobber-impl +# Add your post 'clobber' code here... + + +# all +all: .all-post + +.all-pre: +# Add your pre 'all' code here... + +.all-post: .all-impl +# Add your post 'all' code here... + + +# build tests +build-tests: .build-tests-post + +.build-tests-pre: +# Add your pre 'build-tests' code here... + +.build-tests-post: .build-tests-impl +# Add your post 'build-tests' code here... + + +# run tests +test: .test-post + +.test-pre: build-tests +# Add your pre 'test' code here... + +.test-post: .test-impl +# Add your post 'test' code here... + + +# help +help: .help-post + +.help-pre: +# Add your pre 'help' code here... + +.help-post: .help-impl +# Add your post 'help' code here... + + + +# include project implementation makefile +include nbproject/Makefile-impl.mk + +# include project make variables +include nbproject/Makefile-variables.mk diff --git a/Semester 3/Assignments/functions/arrays.cpp b/Semester 3/Assignments/functions/arrays.cpp new file mode 100644 index 0000000..bfca49c --- /dev/null +++ b/Semester 3/Assignments/functions/arrays.cpp @@ -0,0 +1,48 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/cppFiles/class.cc to edit this template + */ + +/* + * File: arrays.cpp + * Author: caleb + * + * Created on March 1, 2024, 11:11 AM + */ + +#include +using namespace std; +#include "arrays.h" + +void initializeArray (int arr[], const int size) { + for (int i = 0; i < size; ++i) { + arr[i] = i+10; + } +} + +void printArray(int arr[], const int size) { + for (int i = 0; i < size; ++i) { + cout << arr[i] << " "; + } + cout << endl; +} + +int& returnAddressOfFirstElementOfArray (int arr[3]) { + return arr[0]; +} + +int findMaxAndMin(int arr[2][3], int & min) { + int max = arr[0][0]; + min = arr[0][0]; + for (int i = 0; i < 2; ++i) { + for (int j = 0; j < 3; ++j) { + if (min > arr[i][j]) { + min = arr[i][j]; + } + if (max < arr[i][j]) { + max = arr[i][j]; + } + } + } + return max; +} \ No newline at end of file diff --git a/Semester 3/Assignments/functions/arrays.h b/Semester 3/Assignments/functions/arrays.h new file mode 100644 index 0000000..a5990e6 --- /dev/null +++ b/Semester 3/Assignments/functions/arrays.h @@ -0,0 +1,21 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/cppFiles/class.h to edit this template + */ + +/* + * File: arrays.h + * Author: caleb + * + * Created on March 1, 2024, 11:11 AM + */ + +#ifndef ARRAYS_H +#define ARRAYS_H + +void initializeArray (int arr[], const int size); +void printArray(int arr[], const int size); +int& returnReference (int & x); + +#endif /* ARRAYS_H */ + diff --git a/Semester 3/Assignments/functions/functions.cpp b/Semester 3/Assignments/functions/functions.cpp new file mode 100644 index 0000000..93ae443 --- /dev/null +++ b/Semester 3/Assignments/functions/functions.cpp @@ -0,0 +1,46 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/cppFiles/main.cc to edit this template + */ + +/* + * File: functions.cpp + * Author: caleb + * + * Created on March 1, 2024, 10:07 AM + */ + +#include +#include + +using namespace std; +#include "functions.h" + +int global = 0; + +void f1() { + cout << "f1()" << endl; + global++; + f2(); +} + +void f2() { + cout << "f2()" << endl; + global++; +} + +void passByReference(int& x) { + global++; + x = 100; +} + +void staticVarFunction() { + static int staticInt = 10; + staticInt++; + cout << staticInt << endl; +} + +int& returnReference (int & x) { + x++; + return x; +} \ No newline at end of file diff --git a/Semester 3/Assignments/functions/functions.h b/Semester 3/Assignments/functions/functions.h new file mode 100644 index 0000000..3b794c5 --- /dev/null +++ b/Semester 3/Assignments/functions/functions.h @@ -0,0 +1,27 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/cppFiles/file.h to edit this template + */ + +/* + * File: headers.h + * Author: caleb + * + * Created on March 1, 2024, 10:10 AM + */ + +#ifndef HEADERS_H +#define HEADERS_H + + +void f1(); +void f2(); +void passByReference(int& x); +void staticVarFunction(); +int& returnReference (int & x); +int& returnAddressOfFirstElementOfArray (int arr[3]); +int findMaxAndMin(int arr[2][3], int & min) ; + + +#endif /* HEADERS_H */ + diff --git a/Semester 3/Assignments/functions/main.cpp b/Semester 3/Assignments/functions/main.cpp new file mode 100644 index 0000000..a917122 --- /dev/null +++ b/Semester 3/Assignments/functions/main.cpp @@ -0,0 +1,52 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/cppFiles/main.cc to edit this template + */ + +/* + * File: main.cpp + * Author: caleb + * + * Created on March 1, 2024, 10:06 AM + */ + +#include +#include + +using namespace std; +#include "functions.h" +#include "arrays.h" +/* + * + */ +int main(int argc, char** argv) { + f1(); + int y = 10; + passByReference(y); + cout << y << endl; + staticVarFunction(); + staticVarFunction(); + staticVarFunction(); + cout << returnReference(y) << endl; + cout << y << endl; + + int arr1[3] = {1, 2 ,3}; + initializeArray (arr1, 3); + printArray(arr1, 3); + + int& rAr = returnAddressOfFirstElementOfArray(arr1); + + cout << endl; + cout << rAr << " " << &rAr << " " << endl; + int arr2[2][3] = { + {1, 2 ,3}, + {-1, -9, -4} + }; + int min = 0; + cout << "max: " << findMaxAndMin(arr2, min) << endl; + cout << "min: " << endl; + return 0; +} + + + diff --git a/Semester 3/Assignments/functions/nbproject/Makefile-Debug.mk b/Semester 3/Assignments/functions/nbproject/Makefile-Debug.mk new file mode 100644 index 0000000..1a42a87 --- /dev/null +++ b/Semester 3/Assignments/functions/nbproject/Makefile-Debug.mk @@ -0,0 +1,95 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Environment +MKDIR=mkdir +CP=cp +GREP=grep +NM=nm +CCADMIN=CCadmin +RANLIB=ranlib +CC=gcc +CCC=g++ +CXX=g++ +FC=gfortran +AS=as + +# Macros +CND_PLATFORM=GNU-Linux +CND_DLIB_EXT=so +CND_CONF=Debug +CND_DISTDIR=dist +CND_BUILDDIR=build + +# Include project Makefile +include Makefile + +# Object Directory +OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM} + +# Object Files +OBJECTFILES= \ + ${OBJECTDIR}/arrays.o \ + ${OBJECTDIR}/functions.o \ + ${OBJECTDIR}/main.o + + +# C Compiler Flags +CFLAGS= + +# CC Compiler Flags +CCFLAGS= +CXXFLAGS= + +# Fortran Compiler Flags +FFLAGS= + +# Assembler Flags +ASFLAGS= + +# Link Libraries and Options +LDLIBSOPTIONS= + +# Build Targets +.build-conf: ${BUILD_SUBPROJECTS} + "${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/functions + +${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/functions: ${OBJECTFILES} + ${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM} + ${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/functions ${OBJECTFILES} ${LDLIBSOPTIONS} + +${OBJECTDIR}/arrays.o: arrays.cpp + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.cc) -g -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/arrays.o arrays.cpp + +${OBJECTDIR}/functions.o: functions.cpp + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.cc) -g -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/functions.o functions.cpp + +${OBJECTDIR}/main.o: main.cpp + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.cc) -g -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.cpp + +# Subprojects +.build-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + ${RM} -r ${CND_BUILDDIR}/${CND_CONF} + +# Subprojects +.clean-subprojects: + +# Enable dependency checking +.dep.inc: .depcheck-impl + +include .dep.inc diff --git a/Semester 3/Assignments/functions/nbproject/Makefile-Release.mk b/Semester 3/Assignments/functions/nbproject/Makefile-Release.mk new file mode 100644 index 0000000..a5f3c5c --- /dev/null +++ b/Semester 3/Assignments/functions/nbproject/Makefile-Release.mk @@ -0,0 +1,95 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Environment +MKDIR=mkdir +CP=cp +GREP=grep +NM=nm +CCADMIN=CCadmin +RANLIB=ranlib +CC=gcc +CCC=g++ +CXX=g++ +FC=gfortran +AS=as + +# Macros +CND_PLATFORM=GNU-Linux +CND_DLIB_EXT=so +CND_CONF=Release +CND_DISTDIR=dist +CND_BUILDDIR=build + +# Include project Makefile +include Makefile + +# Object Directory +OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM} + +# Object Files +OBJECTFILES= \ + ${OBJECTDIR}/arrays.o \ + ${OBJECTDIR}/functions.o \ + ${OBJECTDIR}/main.o + + +# C Compiler Flags +CFLAGS= + +# CC Compiler Flags +CCFLAGS= +CXXFLAGS= + +# Fortran Compiler Flags +FFLAGS= + +# Assembler Flags +ASFLAGS= + +# Link Libraries and Options +LDLIBSOPTIONS= + +# Build Targets +.build-conf: ${BUILD_SUBPROJECTS} + "${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/functions + +${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/functions: ${OBJECTFILES} + ${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM} + ${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/functions ${OBJECTFILES} ${LDLIBSOPTIONS} + +${OBJECTDIR}/arrays.o: arrays.cpp + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/arrays.o arrays.cpp + +${OBJECTDIR}/functions.o: functions.cpp + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/functions.o functions.cpp + +${OBJECTDIR}/main.o: main.cpp + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.cpp + +# Subprojects +.build-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + ${RM} -r ${CND_BUILDDIR}/${CND_CONF} + +# Subprojects +.clean-subprojects: + +# Enable dependency checking +.dep.inc: .depcheck-impl + +include .dep.inc diff --git a/Semester 3/Assignments/functions/nbproject/Makefile-impl.mk b/Semester 3/Assignments/functions/nbproject/Makefile-impl.mk new file mode 100644 index 0000000..6e48ec9 --- /dev/null +++ b/Semester 3/Assignments/functions/nbproject/Makefile-impl.mk @@ -0,0 +1,133 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a pre- and a post- target defined where you can add customization code. +# +# This makefile implements macros and targets common to all configurations. +# +# NOCDDL + + +# Building and Cleaning subprojects are done by default, but can be controlled with the SUB +# macro. If SUB=no, subprojects will not be built or cleaned. The following macro +# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf +# and .clean-reqprojects-conf unless SUB has the value 'no' +SUB_no=NO +SUBPROJECTS=${SUB_${SUB}} +BUILD_SUBPROJECTS_=.build-subprojects +BUILD_SUBPROJECTS_NO= +BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}} +CLEAN_SUBPROJECTS_=.clean-subprojects +CLEAN_SUBPROJECTS_NO= +CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}} + + +# Project Name +PROJECTNAME=functions + +# Active Configuration +DEFAULTCONF=Debug +CONF=${DEFAULTCONF} + +# All Configurations +ALLCONFS=Debug Release + + +# build +.build-impl: .build-pre .validate-impl .depcheck-impl + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf + + +# clean +.clean-impl: .clean-pre .validate-impl .depcheck-impl + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf + + +# clobber +.clobber-impl: .clobber-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \ + done + +# all +.all-impl: .all-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \ + done + +# build tests +.build-tests-impl: .build-impl .build-tests-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf + +# run tests +.test-impl: .build-tests-impl .test-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf + +# dependency checking support +.depcheck-impl: + @echo "# This code depends on make tool being used" >.dep.inc + @if [ -n "${MAKE_VERSION}" ]; then \ + echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES} \$${TESTOBJECTFILES}))" >>.dep.inc; \ + echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \ + echo "include \$${DEPFILES}" >>.dep.inc; \ + echo "endif" >>.dep.inc; \ + else \ + echo ".KEEP_STATE:" >>.dep.inc; \ + echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \ + fi + +# configuration validation +.validate-impl: + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + echo ""; \ + echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \ + echo "See 'make help' for details."; \ + echo "Current directory: " `pwd`; \ + echo ""; \ + fi + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + exit 1; \ + fi + + +# help +.help-impl: .help-pre + @echo "This makefile supports the following configurations:" + @echo " ${ALLCONFS}" + @echo "" + @echo "and the following targets:" + @echo " build (default target)" + @echo " clean" + @echo " clobber" + @echo " all" + @echo " help" + @echo "" + @echo "Makefile Usage:" + @echo " make [CONF=] [SUB=no] build" + @echo " make [CONF=] [SUB=no] clean" + @echo " make [SUB=no] clobber" + @echo " make [SUB=no] all" + @echo " make help" + @echo "" + @echo "Target 'build' will build a specific configuration and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no'," + @echo " also clean subprojects." + @echo "Target 'clobber' will remove all built files from all configurations and," + @echo " unless 'SUB=no', also from subprojects." + @echo "Target 'all' will will build all configurations and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'help' prints this message." + @echo "" + diff --git a/Semester 3/Assignments/functions/nbproject/Makefile-variables.mk b/Semester 3/Assignments/functions/nbproject/Makefile-variables.mk new file mode 100644 index 0000000..264fb16 --- /dev/null +++ b/Semester 3/Assignments/functions/nbproject/Makefile-variables.mk @@ -0,0 +1,35 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +CND_BASEDIR=`pwd` +CND_BUILDDIR=build +CND_DISTDIR=dist +# Debug configuration +CND_PLATFORM_Debug=GNU-Linux +CND_ARTIFACT_DIR_Debug=dist/Debug/GNU-Linux +CND_ARTIFACT_NAME_Debug=functions +CND_ARTIFACT_PATH_Debug=dist/Debug/GNU-Linux/functions +CND_PACKAGE_DIR_Debug=dist/Debug/GNU-Linux/package +CND_PACKAGE_NAME_Debug=functions.tar +CND_PACKAGE_PATH_Debug=dist/Debug/GNU-Linux/package/functions.tar +# Release configuration +CND_PLATFORM_Release=GNU-Linux +CND_ARTIFACT_DIR_Release=dist/Release/GNU-Linux +CND_ARTIFACT_NAME_Release=functions +CND_ARTIFACT_PATH_Release=dist/Release/GNU-Linux/functions +CND_PACKAGE_DIR_Release=dist/Release/GNU-Linux/package +CND_PACKAGE_NAME_Release=functions.tar +CND_PACKAGE_PATH_Release=dist/Release/GNU-Linux/package/functions.tar +# +# include compiler specific variables +# +# dmake command +ROOT:sh = test -f nbproject/private/Makefile-variables.mk || \ + (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk) +# +# gmake command +.PHONY: $(shell test -f nbproject/private/Makefile-variables.mk || (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk)) +# +include nbproject/private/Makefile-variables.mk diff --git a/Semester 3/Assignments/functions/nbproject/Package-Debug.bash b/Semester 3/Assignments/functions/nbproject/Package-Debug.bash new file mode 100644 index 0000000..2d83e57 --- /dev/null +++ b/Semester 3/Assignments/functions/nbproject/Package-Debug.bash @@ -0,0 +1,76 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=GNU-Linux +CND_CONF=Debug +CND_DISTDIR=dist +CND_BUILDDIR=build +CND_DLIB_EXT=so +NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/functions +OUTPUT_BASENAME=functions +PACKAGE_TOP_DIR=functions/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/functions/bin" +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/functions.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/functions.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff --git a/Semester 3/Assignments/functions/nbproject/Package-Release.bash b/Semester 3/Assignments/functions/nbproject/Package-Release.bash new file mode 100644 index 0000000..8ddf299 --- /dev/null +++ b/Semester 3/Assignments/functions/nbproject/Package-Release.bash @@ -0,0 +1,76 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=GNU-Linux +CND_CONF=Release +CND_DISTDIR=dist +CND_BUILDDIR=build +CND_DLIB_EXT=so +NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/functions +OUTPUT_BASENAME=functions +PACKAGE_TOP_DIR=functions/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/functions/bin" +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/functions.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/functions.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff --git a/Semester 3/Assignments/functions/nbproject/configurations.xml b/Semester 3/Assignments/functions/nbproject/configurations.xml new file mode 100644 index 0000000..67a8b31 --- /dev/null +++ b/Semester 3/Assignments/functions/nbproject/configurations.xml @@ -0,0 +1,86 @@ + + + + + arrays.h + functions.h + + + + + arrays.cpp + functions.cpp + main.cpp + + + + + Makefile + + + Makefile + + + + default + true + false + + + + + + + + + + + + + + + + + default + true + false + + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + + + + + + + + + + diff --git a/Semester 3/Assignments/functions/nbproject/private/Makefile-variables.mk b/Semester 3/Assignments/functions/nbproject/private/Makefile-variables.mk new file mode 100644 index 0000000..a64183e --- /dev/null +++ b/Semester 3/Assignments/functions/nbproject/private/Makefile-variables.mk @@ -0,0 +1,7 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +# Debug configuration +# Release configuration diff --git a/Semester 3/Assignments/functions/nbproject/private/c_standard_headers_indexer.c b/Semester 3/Assignments/functions/nbproject/private/c_standard_headers_indexer.c new file mode 100644 index 0000000..c2548d2 --- /dev/null +++ b/Semester 3/Assignments/functions/nbproject/private/c_standard_headers_indexer.c @@ -0,0 +1,75 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + */ + +// List of standard headers was taken in http://en.cppreference.com/w/c/header + +#include // Conditionally compiled macro that compares its argument to zero +#include // Functions to determine the type contained in character data +#include // Macros reporting error conditions +#include // Limits of float types +#include // Sizes of basic types +#include // Localization utilities +#include // Common mathematics functions +#include // Nonlocal jumps +#include // Signal handling +#include // Variable arguments +#include // Common macro definitions +#include // Input/output +#include // String handling +#include // General utilities: memory management, program utilities, string conversions, random numbers +#include // Time/date utilities +#include // (since C95) Alternative operator spellings +#include // (since C95) Extended multibyte and wide character utilities +#include // (since C95) Wide character classification and mapping utilities +#ifdef _STDC_C99 +#include // (since C99) Complex number arithmetic +#include // (since C99) Floating-point environment +#include // (since C99) Format conversion of integer types +#include // (since C99) Boolean type +#include // (since C99) Fixed-width integer types +#include // (since C99) Type-generic math (macros wrapping math.h and complex.h) +#endif +#ifdef _STDC_C11 +#include // (since C11) alignas and alignof convenience macros +#include // (since C11) Atomic types +#include // (since C11) noreturn convenience macros +#include // (since C11) Thread library +#include // (since C11) UTF-16 and UTF-32 character utilities +#endif diff --git a/Semester 3/Assignments/functions/nbproject/private/configurations.xml b/Semester 3/Assignments/functions/nbproject/private/configurations.xml new file mode 100644 index 0000000..30b54f8 --- /dev/null +++ b/Semester 3/Assignments/functions/nbproject/private/configurations.xml @@ -0,0 +1,72 @@ + + + Makefile + + + + localhost + 2 + + + + + + + + + + + + + + + gdb + + + + "${OUTPUT_PATH}" + + "${OUTPUT_PATH}" + + true + 0 + 0 + + + + + + + localhost + 2 + + + + + + + + + + + + + + + gdb + + + + "${OUTPUT_PATH}" + + "${OUTPUT_PATH}" + + true + 0 + 0 + + + + + + diff --git a/Semester 3/Assignments/functions/nbproject/private/cpp_standard_headers_indexer.cpp b/Semester 3/Assignments/functions/nbproject/private/cpp_standard_headers_indexer.cpp new file mode 100644 index 0000000..04f6fa6 --- /dev/null +++ b/Semester 3/Assignments/functions/nbproject/private/cpp_standard_headers_indexer.cpp @@ -0,0 +1,135 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + */ + +// List of standard headers was taken in http://en.cppreference.com/w/cpp/header + +#include // General purpose utilities: program control, dynamic memory allocation, random numbers, sort and search +#include // Functions and macro constants for signal management +#include // Macro (and function) that saves (and jumps) to an execution context +#include // Handling of variable length argument lists +#include // Runtime type information utilities +#include // std::bitset class template +#include // Function objects, designed for use with the standard algorithms +#include // Various utility components +#include // C-style time/date utilites +#include // typedefs for types such as size_t, NULL and others +#include // Low-level memory management utilities +#include // Higher level memory management utilities +#include // limits of integral types +#include // limits of float types +#include // standardized way to query properties of arithmetic types +#include // Exception handling utilities +#include // Standard exception objects +#include // Conditionally compiled macro that compares its argument to zero +#include // Macro containing the last error number +#include // functions to determine the type contained in character data +#include // functions for determining the type of wide character data +#include // various narrow character string handling functions +#include // various wide and multibyte string handling functions +#include // std::basic_string class template +#include // std::vector container +#include // std::deque container +#include // std::list container +#include // std::set and std::multiset associative containers +#include // std::map and std::multimap associative containers +#include // std::stack container adaptor +#include // std::queue and std::priority_queue container adaptors +#include // Algorithms that operate on containers +#include // Container iterators +#include // Common mathematics functions +#include // Complex number type +#include // Class for representing and manipulating arrays of values +#include // Numeric operations on values in containers +#include // forward declarations of all classes in the input/output library +#include // std::ios_base class, std::basic_ios class template and several typedefs +#include // std::basic_istream class template and several typedefs +#include // std::basic_ostream, std::basic_iostream class templates and several typedefs +#include // several standard stream objects +#include // std::basic_fstream, std::basic_ifstream, std::basic_ofstream class templates and several typedefs +#include // std::basic_stringstream, std::basic_istringstream, std::basic_ostringstream class templates and several typedefs +#include // std::strstream, std::istrstream, std::ostrstream(deprecated) +#include // Helper functions to control the format or input and output +#include // std::basic_streambuf class template +#include // C-style input-output functions +#include // Localization utilities +#include // C localization utilities +#include // empty header. The macros that appear in iso646.h in C are keywords in C++ +#if __cplusplus >= 201103L +#include // (since C++11) std::type_index +#include // (since C++11) Compile-time type information +#include // (since C++11) C++ time utilites +#include // (since C++11) std::initializer_list class template +#include // (since C++11) std::tuple class template +#include // (since C++11) Nested allocator class +#include // (since C++11) fixed-size types and limits of other types +#include // (since C++11) formatting macros , intmax_t and uintmax_t math and conversions +#include // (since C++11) defines std::error_code, a platform-dependent error code +#include // (since C++11) C-style Unicode character conversion functions +#include // (since C++11) std::array container +#include // (since C++11) std::forward_list container +#include // (since C++11) std::unordered_set and std::unordered_multiset unordered associative containers +#include // (since C++11) std::unordered_map and std::unordered_multimap unordered associative containers +#include // (since C++11) Random number generators and distributions +#include // (since C++11) Compile-time rational arithmetic +#include // (since C++11) Floating-point environment access functions +#include // (since C++11) Unicode conversion facilities +#include // (since C++11) Classes, algorithms and iterators to support regular expression processing +#include // (since C++11) Atomic operations library +#include // (since C++11)(deprecated in C++17) simply includes the header +#include // (since C++11)(deprecated in C++17) simply includes the headers (until C++17) (since C++17) and : the overloads equivalent to the contents of the C header tgmath.h are already provided by those headers +#include // (since C++11)(deprecated in C++17) defines one compatibility macro constant +#include // (since C++11)(deprecated in C++17) defines one compatibility macro constant +#include // (since C++11) std::thread class and supporting functions +#include // (since C++11) mutual exclusion primitives +#include // (since C++11) primitives for asynchronous computations +#include // (since C++11) thread waiting conditions +#endif +#if __cplusplus >= 201300L +#include // (since C++14) shared mutual exclusion primitives +#endif +#if __cplusplus >= 201500L +#include // (since C++17) std::any class template +#include // (since C++17) std::optional class template +#include // (since C++17) std::variant class template +#include // (since C++17) Polymorphic allocators and memory resources +#include // (since C++17) std::basic_string_view class template +#include // (since C++17) Predefined execution policies for parallel versions of the algorithms +#include // (since C++17) std::path class and supporting functions +#endif diff --git a/Semester 3/Assignments/functions/nbproject/private/launcher.properties b/Semester 3/Assignments/functions/nbproject/private/launcher.properties new file mode 100644 index 0000000..3edc2d8 --- /dev/null +++ b/Semester 3/Assignments/functions/nbproject/private/launcher.properties @@ -0,0 +1,42 @@ +# Launchers File syntax: +# +# [Must-have property line] +# launcher1.runCommand= +# [Optional extra properties] +# launcher1.displayName= +# launcher1.hide= +# launcher1.buildCommand= +# launcher1.runDir= +# launcher1.runInOwnTab= +# launcher1.symbolFiles= +# launcher1.env.= +# (If this value is quoted with ` it is handled as a native command which execution result will become the value) +# [Common launcher properties] +# common.runDir= +# (This value is overwritten by a launcher specific runDir value if the latter exists) +# common.env.= +# (Environment variables from common launcher are merged with launcher specific variables) +# common.symbolFiles= +# (This value is overwritten by a launcher specific symbolFiles value if the latter exists) +# +# In runDir, symbolFiles and env fields you can use these macroses: +# ${PROJECT_DIR} - project directory absolute path +# ${OUTPUT_PATH} - linker output path (relative to project directory path) +# ${OUTPUT_BASENAME}- linker output filename +# ${TESTDIR} - test files directory (relative to project directory path) +# ${OBJECTDIR} - object files directory (relative to project directory path) +# ${CND_DISTDIR} - distribution directory (relative to project directory path) +# ${CND_BUILDDIR} - build directory (relative to project directory path) +# ${CND_PLATFORM} - platform name +# ${CND_CONF} - configuration name +# ${CND_DLIB_EXT} - dynamic library extension +# +# All the project launchers must be listed in the file! +# +# launcher1.runCommand=... +# launcher2.runCommand=... +# ... +# common.runDir=... +# common.env.KEY=VALUE + +# launcher1.runCommand= \ No newline at end of file diff --git a/Semester 3/Assignments/functions/nbproject/private/private.xml b/Semester 3/Assignments/functions/nbproject/private/private.xml new file mode 100644 index 0000000..63a27a8 --- /dev/null +++ b/Semester 3/Assignments/functions/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + 1 + 0 + + diff --git a/Semester 3/Assignments/functions/nbproject/project.xml b/Semester 3/Assignments/functions/nbproject/project.xml new file mode 100644 index 0000000..3afb38a --- /dev/null +++ b/Semester 3/Assignments/functions/nbproject/project.xml @@ -0,0 +1,28 @@ + + + org.netbeans.modules.cnd.makeproject + + + functions + + cpp + h + UTF-8 + + + + + Debug + 1 + + + Release + 1 + + + + false + + + + diff --git a/Semester 3/Assignments/params.zip b/Semester 3/Assignments/params.zip new file mode 100644 index 0000000..f49a1a6 Binary files /dev/null and b/Semester 3/Assignments/params.zip differ diff --git a/Semester 3/Assignments/params/nb-configuration.xml b/Semester 3/Assignments/params/nb-configuration.xml new file mode 100644 index 0000000..f89ff8d --- /dev/null +++ b/Semester 3/Assignments/params/nb-configuration.xml @@ -0,0 +1,21 @@ + + + + + + 10-web + gfv700ee10 + Facelets + JDK_11__System_ + + diff --git a/Semester 3/Assignments/params/pom.xml b/Semester 3/Assignments/params/pom.xml new file mode 100644 index 0000000..9d5d182 --- /dev/null +++ b/Semester 3/Assignments/params/pom.xml @@ -0,0 +1,48 @@ + + 4.0.0 + asdv + params + 1 + war + params-1 + + + UTF-8 + 10.0.0 + + + + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee} + provided + + + org.primefaces + primefaces + 12.0.0 + jakarta + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + 11 + + + + org.apache.maven.plugins + maven-war-plugin + 3.3.2 + + + + \ No newline at end of file diff --git a/Semester 3/Assignments/params/src/main/java/asdv/JakartaRestConfiguration.java b/Semester 3/Assignments/params/src/main/java/asdv/JakartaRestConfiguration.java new file mode 100644 index 0000000..d99993b --- /dev/null +++ b/Semester 3/Assignments/params/src/main/java/asdv/JakartaRestConfiguration.java @@ -0,0 +1,13 @@ +package asdv; + +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; + +/** + * Configures Jakarta RESTful Web Services for the application. + * @author Juneau + */ +@ApplicationPath("resources") +public class JakartaRestConfiguration extends Application { + +} diff --git a/Semester 3/Assignments/params/src/main/java/asdv/resources/JakartaEE10Resource.java b/Semester 3/Assignments/params/src/main/java/asdv/resources/JakartaEE10Resource.java new file mode 100644 index 0000000..608b0fc --- /dev/null +++ b/Semester 3/Assignments/params/src/main/java/asdv/resources/JakartaEE10Resource.java @@ -0,0 +1,20 @@ +package asdv.resources; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.Response; + +/** + * + * @author + */ +@Path("jakartaee10") +public class JakartaEE10Resource { + + @GET + public Response ping(){ + return Response + .ok("ping Jakarta EE") + .build(); + } +} diff --git a/Semester 3/Assignments/params/src/main/java/beans/ClientBean.java b/Semester 3/Assignments/params/src/main/java/beans/ClientBean.java new file mode 100644 index 0000000..bc1a6fb --- /dev/null +++ b/Semester 3/Assignments/params/src/main/java/beans/ClientBean.java @@ -0,0 +1,58 @@ + +package beans; + +import jakarta.enterprise.context.RequestScoped; +import java.util.Map; +import jakarta.faces.application.FacesMessage; +import jakarta.faces.context.FacesContext; +import jakarta.inject.Named; +import utilities.UtilitiesDatabase; + +@Named(value = "clientBean") +@RequestScoped +public class ClientBean +{ + + private String fromCallerUrlOfParent; + private String fromCallerStockId; + private Map map; + + public Map getMap() + { + return map; + } + + + + + public ClientBean() + { + getParametersFromCaller(); + + } + + private void getParametersFromCaller() + { + //> Get parameters from caller + Map m = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap(); + this.fromCallerUrlOfParent = m.get("url_of_parent_param1"); + this.fromCallerStockId = m.get("stock_id_param2"); + UtilitiesDatabase.addMessage(FacesMessage.SEVERITY_INFO, "mouseOutListener", ""); + map = m; + } + + public String getFromCallerUrlOfParent() + { + return fromCallerUrlOfParent; + } + + public String getFromCallerStockId() + { + return fromCallerStockId; + } + + public void getRequestFromMap() { + map = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap(); + } + +} diff --git a/Semester 3/Assignments/params/src/main/java/beans/StockBean.java b/Semester 3/Assignments/params/src/main/java/beans/StockBean.java new file mode 100644 index 0000000..0d32d62 --- /dev/null +++ b/Semester 3/Assignments/params/src/main/java/beans/StockBean.java @@ -0,0 +1,61 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package beans; + +import bl.DataFromDatabase; +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.SessionScoped; +import jakarta.faces.application.ConfigurableNavigationHandler; +import jakarta.faces.context.ExternalContext; +import jakarta.faces.context.FacesContext; +import jakarta.inject.Inject; +import jakarta.inject.Named; +import java.io.Serializable; +import java.util.List; +import org.primefaces.event.SelectEvent; +import pojos.Stock; + +/** + * + * @author asdv5 + */ +@Named(value = "stockBean") +@SessionScoped +public class StockBean implements Serializable +{ + @Inject + DataFromDatabase dbData; + List stocks; + + + @PostConstruct + void init() + { + stocks = dbData.getList(); + } + + public List getStocks() + { + return stocks; + } + + public void setStocks(List stocks) + { + this.stocks = stocks; + } + + + public void onRowSelect(SelectEvent event) + { + FacesContext fc = FacesContext.getCurrentInstance(); + ExternalContext ec = fc.getExternalContext(); + Stock a = (Stock) event.getObject(); + String page = "client-page"; + String params = "&url_of_parent_param1=" + "index"; + params += "&stock_id_param2=" + a.getStockId(); + ConfigurableNavigationHandler handler = (ConfigurableNavigationHandler) fc.getApplication().getNavigationHandler(); + handler.performNavigation(page + "?faces-redirect=true" + params); + } +} diff --git a/Semester 3/Assignments/params/src/main/java/bl/DataFromDatabase.java b/Semester 3/Assignments/params/src/main/java/bl/DataFromDatabase.java new file mode 100644 index 0000000..2c1ca17 --- /dev/null +++ b/Semester 3/Assignments/params/src/main/java/bl/DataFromDatabase.java @@ -0,0 +1,40 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package bl; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import pojos.Stock; + +/** + * + * @author asdv5 + */ +public class DataFromDatabase implements Serializable +{ + private List list = new ArrayList<>(); + + public DataFromDatabase() + { + for (int i = 1; i <= 100; ++i) + { + String stockId = "stockID" + i; + String companyName = "stockID" + i; + double priceCurrent = Math.random() * 1000; + double priceClosing = priceCurrent + Math.random() * 10; + long numberOfSharesAvailable = (long) (Math.random() * 10000000); + long numberOfSharesSold = numberOfSharesAvailable / 3; + list.add(new Stock(stockId, companyName, priceCurrent, priceClosing, numberOfSharesAvailable, numberOfSharesSold)); + } + } + + public List getList() + { + return list; + } + + +} diff --git a/Semester 3/Assignments/params/src/main/java/pojos/Stock.java b/Semester 3/Assignments/params/src/main/java/pojos/Stock.java new file mode 100644 index 0000000..9242b4c --- /dev/null +++ b/Semester 3/Assignments/params/src/main/java/pojos/Stock.java @@ -0,0 +1,138 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package pojos; + +import java.io.Serializable; + + +public class Stock implements Serializable +{ + private static final long serialVersionUID = 1L; + + private String stockId; + + private String companyName; + + private double priceCurrent; + + private double priceClosing; + + private long numberOfSharesAvailable; + + private long numberOfSharesSold; + + public Stock() + { + } + + public Stock(String stockId) + { + this.stockId = stockId; + } + + public Stock(String stockId, String companyName, double priceCurrent, double priceClosing, long numberOfSharesAvailable, long numberOfSharesSold) + { + this.stockId = stockId; + this.companyName = companyName; + this.priceCurrent = priceCurrent; + this.priceClosing = priceClosing; + this.numberOfSharesAvailable = numberOfSharesAvailable; + this.numberOfSharesSold = numberOfSharesSold; + } + + public String getStockId() + { + return stockId; + } + + public void setStockId(String stockId) + { + this.stockId = stockId; + } + + public String getCompanyName() + { + return companyName; + } + + public void setCompanyName(String companyName) + { + this.companyName = companyName; + } + + public double getPriceCurrent() + { + return priceCurrent; + } + + public void setPriceCurrent(double priceCurrent) + { + this.priceCurrent = priceCurrent; + } + + public double getPriceClosing() + { + return priceClosing; + } + + public void setPriceClosing(double priceClosing) + { + this.priceClosing = priceClosing; + } + + public long getNumberOfSharesAvailable() + { + return numberOfSharesAvailable; + } + + public void setNumberOfSharesAvailable(long numberOfSharesAvailable) + { + this.numberOfSharesAvailable = numberOfSharesAvailable; + } + + public long getNumberOfSharesSold() + { + return numberOfSharesSold; + } + + public void setNumberOfSharesSold(long numberOfSharesSold) + { + this.numberOfSharesSold = numberOfSharesSold; + } + + + @Override + public int hashCode() + { + int hash = 0; + hash += (stockId != null ? stockId.hashCode() : 0); + return hash; + } + + @Override + public boolean equals(Object object) + { + // TODO: Warning - this method won't work in the case the id fields are not set + if (!(object instanceof Stock)) + { + return false; + } + Stock other = (Stock) object; + if ((this.stockId == null && other.stockId != null) || (this.stockId != null && !this.stockId.equals(other.stockId))) + { + return false; + } + return true; + } + + @Override + public String toString() + { + return "asdv.mp1_ajax.entities.Stock[ stockId=" + stockId + " ]"; + } + + + +} diff --git a/Semester 3/Assignments/params/src/main/java/utilities/UtilitiesDatabase.java b/Semester 3/Assignments/params/src/main/java/utilities/UtilitiesDatabase.java new file mode 100644 index 0000000..5121af2 --- /dev/null +++ b/Semester 3/Assignments/params/src/main/java/utilities/UtilitiesDatabase.java @@ -0,0 +1,111 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package utilities; + +import jakarta.faces.application.FacesMessage; +import jakarta.faces.context.FacesContext; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Iterator; + +public class UtilitiesDatabase +{ + public Connection connection( + String databaseName, + String userName, + String password, + String URL2 + ) throws SQLException, InstantiationException, + IllegalAccessException, ClassNotFoundException + { + Connection con; + try + {// Load Sun's jdbc driver + Class.forName(URL2).newInstance(); + System.out.println("JDBC Driver loaded!"); + } + catch (Exception e) // driver not found + { + System.err.println("Unable to load database driver"); + System.err.println("Details : " + e); + throw e; + } + String ip = "localhost"; //internet connection + String url = "jdbc:mysql://" + ip + ":8889/" + databaseName + "?useSSL=false"; + try + { + con = DriverManager.getConnection(url, userName, password); + con.setReadOnly(false); + } + catch (Exception e) + { + System.err.println(e.toString()); + throw e; + } + System.out.println("connection successfull"); + return con; + } + + public void closeDatabaseConnection(Connection con) + throws SQLException + { + try + { + if (con != null) + { + con.close(); + } + } + catch (SQLException e) + { + System.out.println(e); + e.printStackTrace(); + throw e; + } + } + + public static java.sql.Date stringDateToSqlDate(String sDate) + { + java.util.Date date = null; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + try + { + date = sdf.parse(sDate); + } + catch (ParseException e) + { + e.printStackTrace(); + } + return new java.sql.Date(date.getTime()); + } + + public static java.util.Date stringDateToJavaUtilitiesDate(String sDate) + { + java.sql.Date sqldate = stringDateToSqlDate(sDate); + return new java.util.Date(sqldate.getTime()); + } + + + public static void addMessage(FacesMessage.Severity severity, String summary, String detail) + { + FacesMessage msg = new FacesMessage(severity, summary, detail); + FacesContext.getCurrentInstance().addMessage(null, msg); + } + + public static void clearAllMessages() + { + FacesContext context = FacesContext.getCurrentInstance(); + Iterator it = context.getMessages(); + while (it.hasNext()) + { + it.next(); + it.remove(); + } + } + +} diff --git a/Semester 3/Assignments/params/src/main/resources/META-INF/persistence.xml b/Semester 3/Assignments/params/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..7582bf1 --- /dev/null +++ b/Semester 3/Assignments/params/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Semester 3/Assignments/params/src/main/webapp/WEB-INF/beans.xml b/Semester 3/Assignments/params/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 0000000..9dfae34 --- /dev/null +++ b/Semester 3/Assignments/params/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/Semester 3/Assignments/params/src/main/webapp/WEB-INF/glassfish-web.xml b/Semester 3/Assignments/params/src/main/webapp/WEB-INF/glassfish-web.xml new file mode 100644 index 0000000..673cc06 --- /dev/null +++ b/Semester 3/Assignments/params/src/main/webapp/WEB-INF/glassfish-web.xml @@ -0,0 +1,25 @@ + + + + + + + + Keep a copy of the generated servlet class' java code. + + + diff --git a/Semester 3/Assignments/params/src/main/webapp/WEB-INF/web.xml b/Semester 3/Assignments/params/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..fcfcd54 --- /dev/null +++ b/Semester 3/Assignments/params/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,24 @@ + + + + jakarta.faces.PROJECT_STAGE + Development + + + Faces Servlet + jakarta.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + + 30 + + + + faces/index.xhtml + + diff --git a/Semester 3/Assignments/params/src/main/webapp/client-page.xhtml b/Semester 3/Assignments/params/src/main/webapp/client-page.xhtml new file mode 100644 index 0000000..c77de66 --- /dev/null +++ b/Semester 3/Assignments/params/src/main/webapp/client-page.xhtml @@ -0,0 +1,29 @@ + + + + + Client + + + + + +

Client's Page

+ page that called this page: #{clientBean.fromCallerUrlOfParent} +
+ stock id passed: #{clientBean.fromCallerStockId} +
+ #{clientBean.map} + +
+
+ + diff --git a/Semester 3/Assignments/params/src/main/webapp/index.xhtml b/Semester 3/Assignments/params/src/main/webapp/index.xhtml new file mode 100644 index 0000000..e7679fa --- /dev/null +++ b/Semester 3/Assignments/params/src/main/webapp/index.xhtml @@ -0,0 +1,84 @@ + + + + + MP1 Ajax + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ diff --git a/Semester 3/Assignments/templates4_2/nb-configuration.xml b/Semester 3/Assignments/templates4_2/nb-configuration.xml new file mode 100644 index 0000000..688a68d --- /dev/null +++ b/Semester 3/Assignments/templates4_2/nb-configuration.xml @@ -0,0 +1,21 @@ + + + + + + Facelets + ide + gfv700ee10 + JDK_15__System_ + + diff --git a/Semester 3/Assignments/templates4_2/pom.xml b/Semester 3/Assignments/templates4_2/pom.xml new file mode 100644 index 0000000..af4225c --- /dev/null +++ b/Semester 3/Assignments/templates4_2/pom.xml @@ -0,0 +1,48 @@ + + 4.0.0 + asdv + templates4_2 + 1 + war + templates4_2-1 + + + UTF-8 + 10.0.0 + + + + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee} + provided + + + org.primefaces + primefaces + 10.0.0 + jakarta + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 11 + 11 + + + + org.apache.maven.plugins + maven-war-plugin + 3.3.2 + + + + \ No newline at end of file diff --git a/Semester 3/Assignments/templates4_2/src/main/java/beans/Admin.java b/Semester 3/Assignments/templates4_2/src/main/java/beans/Admin.java new file mode 100644 index 0000000..c2c129a --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/java/beans/Admin.java @@ -0,0 +1,46 @@ +package beans; + +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ + +import jakarta.inject.Named; +import jakarta.enterprise.context.RequestScoped; + +/** + * + * @author asdv5 + */ +@Named(value = "admin") +@RequestScoped +public class Admin { + + private String userName; + + private String password; + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String validate() + { + return "index"; + } + + +} diff --git a/Semester 3/Assignments/templates4_2/src/main/resources/META-INF/persistence.xml b/Semester 3/Assignments/templates4_2/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..7582bf1 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/WEB-INF/beans.xml b/Semester 3/Assignments/templates4_2/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 0000000..9dfae34 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/WEB-INF/glassfish-web.xml b/Semester 3/Assignments/templates4_2/src/main/webapp/WEB-INF/glassfish-web.xml new file mode 100644 index 0000000..673cc06 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/WEB-INF/glassfish-web.xml @@ -0,0 +1,25 @@ + + + + + + + + Keep a copy of the generated servlet class' java code. + + + diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/WEB-INF/web.xml b/Semester 3/Assignments/templates4_2/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..fcfcd54 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,24 @@ + + + + jakarta.faces.PROJECT_STAGE + Development + + + Faces Servlet + jakarta.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + + 30 + + + + faces/index.xhtml + + diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/index.xhtml b/Semester 3/Assignments/templates4_2/src/main/webapp/index.xhtml new file mode 100644 index 0000000..658d935 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/index.xhtml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + ASDV at SLCC + + + + + + + + + + + + + + + + + + + + We develop software with style... + + + + + + diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/bottomStyle.css b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/bottomStyle.css new file mode 100644 index 0000000..eeca699 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/bottomStyle.css @@ -0,0 +1,18 @@ +#bottom { + margin: 0px 0px 0px 0px; + text-align:center; + color: #ffffff; + + background-image: -webkit-gradient( + linear, + left top, + left bottom, + color-stop(0, blue), + color-stop(1, blue) + ); + background-image: -o-linear-gradient(bottom, blue 0%, #120205 100%); + background-image: -moz-linear-gradient(bottom, blue 0%, #120205 100%); + background-image: -webkit-linear-gradient(bottom, blue 0%, #120205 100%); + background-image: -ms-linear-gradient(bottom, blue 0%, #120205 100%); + background-image: linear-gradient(to bottom, blue 0%, #120205 100%); +} diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/contentStyle.css b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/contentStyle.css new file mode 100644 index 0000000..f505a90 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/contentStyle.css @@ -0,0 +1,3 @@ +#content { + background: white; +} diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/cssLayout.css b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/cssLayout.css new file mode 100644 index 0000000..9b22b84 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/cssLayout.css @@ -0,0 +1,51 @@ +#wrapper { + margin-left:auto; + margin-right:auto; +} + +#title { + position: relative; + margin: 1px 0px 0px 0px; +} + +#login_and_search { + position: relative; + margin: 0px 0px 5px 0px; +} + +#login { + float: left; + position: relative; +} + +#search { + float: right; + position: relative; +} + +#top { + position: relative; + overflow: hidden; + +} + +#bottom { + position: relative; +} + +#left { + float: left; +} + +#logo { + float: left; +} + +#right { + float: right; +} + +#content { + overflow: hidden; +} + diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/default.css b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/default.css new file mode 100644 index 0000000..6878f58 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/default.css @@ -0,0 +1,8 @@ + +body { + background-color: #fff; + font-size: 1em; + font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + color: #222; + margin: 2px; +} diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/dummy.css b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/dummy.css new file mode 100644 index 0000000..139597f --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/dummy.css @@ -0,0 +1,2 @@ + + diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/imageZoomStyle.css b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/imageZoomStyle.css new file mode 100644 index 0000000..6f07773 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/imageZoomStyle.css @@ -0,0 +1,38 @@ + +* {box-sizing: border-box;} + + +.img-zoom-container { + position: relative; + z-index: 0; +} + +.img-zoom-lens { + position: absolute ; + border-radius: 30px; + + border: 1px solid #d4d4d4; + /*set the size of the lens:*/ + width: 40px; + height: 40px; + z-index: 10; + +} + +.img-zoom-result { + + border: 1px solid #d4d4d4; + /*set the size of the result div:*/ + width: 300px; + height: 300px; + position: relative; + z-index: 1; +} +.myDiv +{ + align: center; + padding: 30px; + margin: 10; + border-left: 10px solid navy; +} + diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/leftStyle.css b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/leftStyle.css new file mode 100644 index 0000000..aaafa7d --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/leftStyle.css @@ -0,0 +1,22 @@ +#left { + + background-image: -webkit-gradient( + linear, + left top, + left bottom, + color-stop(0, #2D4A37), + color-stop(1, #789480) + ); + background-image: -o-linear-gradient(bottom, #2D4A37 0%, #789480 100%); + background-image: -moz-linear-gradient(bottom, #2D4A37 0%, #789480 100%); + background-image: -webkit-linear-gradient(bottom, #2D4A37 0%, #789480 100%); + background-image: -ms-linear-gradient(bottom, #2D4A37 0%, #789480 100%); + background-image: linear-gradient(to bottom, #2D4A37 0%, #789480 100%); + -moz-box-shadow: 0px 0px 15px 3px #333333; + -webkit-box-shadow: 0px 0px 15px 3px #333333; + box-shadow: 0px 0px 15px 3px #333333; + + text-align:left; + padding-left:10px; + margin-right: 5px; +} diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/loginStyle.css b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/loginStyle.css new file mode 100644 index 0000000..dc54e57 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/loginStyle.css @@ -0,0 +1,65 @@ +.inputs { + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + background-color: #222; + background: -moz-linear-gradient(top, #FFF, #EAEAEA); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0.0, #FFF), color-stop(1.0, #EAEAEA)); + border: 1px solid #CACACA; + color: #444; + font-size: 1.1em; + margin: 0px 10px 0px 0px; + padding-left: 2px; + width:200px; +} +.inputs:focus { + color: #ffffff; + background: #cc0000; + -webkit-box-shadow: 0 0 25px #CCC; + -moz-box-shadow: 0 0 25px #cccc00; + box-shadow: 0 0 25px #CCCC00; + -webkit-transform: scale(1.05); + -moz-transform: scale(1.05); + transform: scale(1.05); +} + +.lbutton { + -moz-box-shadow: 4px 7px 13px -7px #276873; + -webkit-box-shadow: 4px 7px 13px -7px #276873; + box-shadow: 4px 7px 13px -7px #276873; + background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #171717), color-stop(1, #d92323)); + background:-moz-linear-gradient(top, #171717 5%, #222 100%); + background:-webkit-linear-gradient(top, #171717 5%, #222 100%); + background:-o-linear-gradient(top, #171717 5%, #222 100%); + background:-ms-linear-gradient(top, #171717 5%, #222 100%); + background:linear-gradient(to bottom, #171717 5%, #222 100%); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#171717', endColorstr='#d92323',GradientType=0); + background-color:#222; + -moz-border-radius:17px; + -webkit-border-radius:17px; + border-radius:17px; + display:inline-block; + cursor:pointer; + color:#ffffff; + font-family:arial; + font-size:12px; + font-weight:bold; + padding:2px 12px; + text-decoration:none; + text-shadow:0px 1px 0px #3d768a; +} +.lbutton:hover { + background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #222), color-stop(1, #171717)); + background:-moz-linear-gradient(top, #00f 5%, #222 100%); + background:-webkit-linear-gradient(top, 00f 5%, #222 100%); + background:-o-linear-gradient(top, #00f 5%, #222 100%); + background:-ms-linear-gradient(top, #00f 5%, #222 100%); + background:linear-gradient(to bottom, #00f 5%, #222 100%); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#d92323', endColorstr='#222',GradientType=0); + background-color:#222; +} +.lbutton:active { + position:relative; + top:1px; +} + + diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/login_and_searchStyle.css b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/login_and_searchStyle.css new file mode 100644 index 0000000..72a21f3 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/login_and_searchStyle.css @@ -0,0 +1,5 @@ +#login_and_search { + height:20px; + background-color: white; + padding: 10px; +} diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/logoStyle.css b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/logoStyle.css new file mode 100644 index 0000000..31f9e01 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/logoStyle.css @@ -0,0 +1,7 @@ +#logo { + background-image:url("#{resource['images/site/logo.png']}"); + margin-right: 0px; + width:80px; + height:120px; + +} diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/menuStyle.css b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/menuStyle.css new file mode 100644 index 0000000..b78b55b --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/menuStyle.css @@ -0,0 +1,37 @@ +#menu { + white-space: nowrap; + height: 28px; + width:100%; + background: #fff url("#{resource['images/site/menu.png']}") bottom center ; + margin-bottom: 5px; +} + +#menu ul { + margin: 0; + padding: 0; + list-style:none; + float:left; +} + +#menu li { + float: left; + margin: 0 3px 0 3px; + padding: 0; + background: transparent; +} + +#menu a { + font-family: Arial, Helvetica, sans-serif; + font-size: 15px; + font-weight: normal; + float:left; + display:block; + height: 26px; + line-height: 24px; + padding: 2px 10px 0 10px; + color: #cccc00; + text-decoration: none; + background: transparent; + +} + \ No newline at end of file diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/rightStyle.css b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/rightStyle.css new file mode 100644 index 0000000..4c5502a --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/rightStyle.css @@ -0,0 +1,5 @@ +#right { + background-color: #FA0519; + text-align:center; + margin-left: 5px; +} diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/searchStyle.css b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/searchStyle.css new file mode 100644 index 0000000..57e52f1 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/searchStyle.css @@ -0,0 +1,3 @@ +#search { + color: #ffffff; +} diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/stylesLinks.css b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/stylesLinks.css new file mode 100644 index 0000000..eef30a3 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/stylesLinks.css @@ -0,0 +1,67 @@ + +a { + font-family: Arial, Helvetica, sans-serif; + font-size: 15px; + font-weight: normal; + float:left; + display:block; + height: 26px; + line-height: 24px; + padding: 2px 10px 0 10px; + color: #cccc00; + text-decoration:#A3979A; + background-color: white; + border: white; + padding: 0px +} +a.hover { + float: left; + font-family: Arial, Helvetica, sans-serif; + font-size: 15px; + font-weight: normal; + float:left; + display:block; + height: 26px; + line-height: 24px; + color: #cccc00; + text-decoration: none; + + background-color: white; + border: white; + padding: 0px +} + +.menus +{ + font-family: Arial, Helvetica, sans-serif; + font-size: 15px; + font-weight: normal; + float:right; + + + color: #cccc00; + text-decoration:#A3979A; + background-color: white; + border: white; + padding: 0px ; + margin-top: 0px; + margin-right: 0px; + margin-bottom: 0px; + margin-left: 0px; +} + + .affaires .ui-menuitem-text{color:#cccc00; + decoration: bold, italic; + + } + .affaires .ui-menu-child{background: white; mouseover: #000; + background-color: #A80000;} + .affaires .ui-menubar{mouseover: #000; + background-color: #A80000;} + .affaires .ui-state-hover {} + + a.active { + color: #D09d23; + font-weight: bold; + background-color : #c7c3c3; +} \ No newline at end of file diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/titleStyle.css b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/titleStyle.css new file mode 100644 index 0000000..e02c1b8 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/titleStyle.css @@ -0,0 +1,9 @@ +#title { + background: white; + color:blue; + text-align:center; + font-size: 38px; + font-weight: bold; +} + + diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/topPhones.css b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/topPhones.css new file mode 100644 index 0000000..c0407a9 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/topPhones.css @@ -0,0 +1,14 @@ +#topPhones { + color: #cc0000; + font-family: 'Arial Black', Gadget, sans-serif; + font-size: 15px; + text-align: center; + height:120px; + text-shadow: 0 0 4px rgb(255, 255, 255), + 0 -5px 4px rgb(255, 255, 51), + 2px -10px 6px rgb(255, 221, 51), + -2px -15px 11px rgb(255, 136, 0), + 2px -25px 18px rgb(255, 34, 0); + background: white; + +} diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/topStyle.css b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/topStyle.css new file mode 100644 index 0000000..90fbd35 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/topStyle.css @@ -0,0 +1,8 @@ +#top { + color: blue; + font-family: 'Zapfino', Gadget, sans-serif; + font-size: 36px; + text-align: center; + height:120px; + background: white; +} diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/zoomcss.css b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/zoomcss.css new file mode 100644 index 0000000..c93db05 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/css/zoomcss.css @@ -0,0 +1,24 @@ + +* {margin: 0; padding: 0;} +.magnify {width: 200px; margin: 50px auto; position: relative;} + +/*Lets create the magnifying glass*/ +.large { + width: 175px; height: 175px; + position: absolute; + border-radius: 100%; + + /*Multiple box shadows to achieve the glass effect*/ + box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.85), + 0 0 7px 7px rgba(0, 0, 0, 0.25), + inset 0 0 40px 2px rgba(0, 0, 0, 0.25); + + /*Lets load up the large image first*/ + background: url('#{itemsBean.curImage}') no-repeat; + + /*hide the glass by default*/ + display: none; +} + +/*To solve overlap bug at the edges during magnification*/ +.small { display: block; } diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/photos_original/iPhone11.png b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/photos_original/iPhone11.png new file mode 100644 index 0000000..941b73e Binary files /dev/null and b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/photos_original/iPhone11.png differ diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/photos_original/sumsung.jpg b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/photos_original/sumsung.jpg new file mode 100644 index 0000000..5d80cff Binary files /dev/null and b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/photos_original/sumsung.jpg differ diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/site/iPhone11.png b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/site/iPhone11.png new file mode 100644 index 0000000..941b73e Binary files /dev/null and b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/site/iPhone11.png differ diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/site/logo.png b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/site/logo.png new file mode 100644 index 0000000..1f543fd Binary files /dev/null and b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/site/logo.png differ diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/site/menu.png b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/site/menu.png new file mode 100644 index 0000000..65797be Binary files /dev/null and b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/site/menu.png differ diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/site/next.png b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/site/next.png new file mode 100644 index 0000000..e7972c9 Binary files /dev/null and b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/site/next.png differ diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/site/previous.png b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/site/previous.png new file mode 100644 index 0000000..89b87ac Binary files /dev/null and b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/site/previous.png differ diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/site/sumsung.jpg b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/site/sumsung.jpg new file mode 100644 index 0000000..5d80cff Binary files /dev/null and b/Semester 3/Assignments/templates4_2/src/main/webapp/resources/images/site/sumsung.jpg differ diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates.zip b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates.zip new file mode 100644 index 0000000..f57d699 Binary files /dev/null and b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates.zip differ diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/bottomDefault.xhtml b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/bottomDefault.xhtml new file mode 100644 index 0000000..1925805 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/bottomDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + +

This is default footer

+
+
+ diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/contentDefault.xhtml b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/contentDefault.xhtml new file mode 100644 index 0000000..81c4495 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/contentDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + This is default content + + + diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/leftDefault.xhtml b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/leftDefault.xhtml new file mode 100644 index 0000000..2d55e25 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/leftDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + This is default left side + + + diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/loginDefault.xhtml b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/loginDefault.xhtml new file mode 100644 index 0000000..b1dd7a8 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/loginDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + Default Login Section + + + diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/logoDefault.xhtml b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/logoDefault.xhtml new file mode 100644 index 0000000..594aad6 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/logoDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + +

LOGO

+
+
+ diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/menuDefault.xhtml b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/menuDefault.xhtml new file mode 100644 index 0000000..108f375 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/menuDefault.xhtml @@ -0,0 +1,22 @@ + + + + + + + +
    + +
  • + +
  • +
    +
+
+
+
+ diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/rightDefault.xhtml b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/rightDefault.xhtml new file mode 100644 index 0000000..9aabcc8 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/rightDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + This is default right side + + + diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/searchDefault.xhtml b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/searchDefault.xhtml new file mode 100644 index 0000000..80b6c4b --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/searchDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + Default Search Section + + + diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/titleDefault.xhtml b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/titleDefault.xhtml new file mode 100644 index 0000000..7c9eeb4 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/titleDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + This is default title + + + diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/topDefault.xhtml b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/topDefault.xhtml new file mode 100644 index 0000000..f1b76a0 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/default_templates/topDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + +

This is default header

+
+
+ diff --git a/Semester 3/Assignments/templates4_2/src/main/webapp/templates/layout_templates/layout.xhtml b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/layout_templates/layout.xhtml new file mode 100644 index 0000000..1879ae3 --- /dev/null +++ b/Semester 3/Assignments/templates4_2/src/main/webapp/templates/layout_templates/layout.xhtml @@ -0,0 +1,88 @@ + + + + + + + Layout Template + + + + + + + + + + + Layout Template + + + +
+ +
+ + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+ +
+ + + +
+
+
+
+ diff --git a/Semester 3/Assignments/templatesMatricesSample.zip b/Semester 3/Assignments/templatesMatricesSample.zip new file mode 100644 index 0000000..ec869c4 Binary files /dev/null and b/Semester 3/Assignments/templatesMatricesSample.zip differ diff --git a/Semester 3/Assignments/templatesMatricesSample/nb-configuration.xml b/Semester 3/Assignments/templatesMatricesSample/nb-configuration.xml new file mode 100644 index 0000000..c678822 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/nb-configuration.xml @@ -0,0 +1,21 @@ + + + + + + 10-web + gfv700ee10 + JSP + ide + + diff --git a/Semester 3/Assignments/templatesMatricesSample/pom.xml b/Semester 3/Assignments/templatesMatricesSample/pom.xml new file mode 100644 index 0000000..a4920f9 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/pom.xml @@ -0,0 +1,83 @@ + + 4.0.0 + edu.slcc.asdv + TemplatesMatricesSample + 1 + war + TemplatesMatricesSample + + + 11 + ${project.build.directory}/endorsed + UTF-8 + false + 9.1.0 + + + + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee} + provided + + + org.primefaces + primefaces + 12.0.0 + jakarta + + + org.apache.poi + poi + 5.2.2 + jar + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + + -Djava.endorsed.dirs=${endorsed.dir} + + + + + org.apache.maven.plugins + maven-war-plugin + 3.3.2 + + + org.apache.maven.plugins + maven-dependency-plugin + 3.3.0 + + + validate + + copy + + + ${endorsed.dir} + true + + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee} + jar + + + + + + + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/beans/MatrixBeanA.java b/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/beans/MatrixBeanA.java new file mode 100644 index 0000000..c2f6b2e --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/beans/MatrixBeanA.java @@ -0,0 +1,48 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package edu.slcc.asdv.beans; + +import jakarta.inject.Named; +import jakarta.faces.view.ViewScoped; +import java.io.Serializable; +import java.util.ArrayList; + +/** + * + * @author A. V. Markou + */ +@Named(value = "matrixBeanA") +@ViewScoped +public class MatrixBeanA implements Serializable +{ + ArrayList> matrix = new ArrayList>(); + + public MatrixBeanA() + { + ArrayList row1 = new ArrayList(); + ArrayList row2 = new ArrayList(); + row1.add("1"); + row1.add("1"); + row2.add("3"); + row2.add("2"); + matrix = new ArrayList>(); + matrix.add(row1); + matrix.add(row2); + } + + public void listenForKeyUp(int i, int j, String input) + { + System.out.println("i=" + i); + System.out.println("j=" + j); + System.out.println("input=" + input); + matrix.get(i).set(j, input); + + } + + public ArrayList> getMatrix() + { + return matrix; + } +} diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/beans/MatrixBeanB.java b/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/beans/MatrixBeanB.java new file mode 100644 index 0000000..ed76c94 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/beans/MatrixBeanB.java @@ -0,0 +1,50 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package edu.slcc.asdv.beans; + +import jakarta.inject.Named; +import jakarta.faces.view.ViewScoped; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import org.primefaces.PrimeFaces; + +/** + * + * @author A. V. Markou + */ +@Named(value = "matrixBeanB") +@ViewScoped +public class MatrixBeanB implements Serializable +{ + + ArrayList> matrix = new ArrayList>(); + + public MatrixBeanB() + { + ArrayList row1 = new ArrayList(); + ArrayList row2 = new ArrayList(); + row1.add("4"); + row1.add("5"); + row2.add("6"); + row2.add("7"); + matrix = new ArrayList>(); + matrix.add(row1); + matrix.add(row2); + } + + public void listenForKeyUp(int i, int j, String input) + { + System.out.println("i=" + i); + System.out.println("j=" + j); + System.out.println("input=" + input); + matrix.get(i).set(j, input); + } + + public ArrayList> getMatrix() + { + return matrix; + } +} diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/beans/MatrixBeanC.java b/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/beans/MatrixBeanC.java new file mode 100644 index 0000000..8d1c8e2 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/beans/MatrixBeanC.java @@ -0,0 +1,49 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package edu.slcc.asdv.beans; + +import jakarta.inject.Named; +import jakarta.faces.view.ViewScoped; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; + +/** + * + * @author A. V. Markou + */ +@Named(value = "matrixBeanC") +@ViewScoped +public class MatrixBeanC implements Serializable +{ + + ArrayList> matrix = new ArrayList>(); + + + public MatrixBeanC() + { + ArrayList row1 = new ArrayList(); + ArrayList row2 = new ArrayList(); + row1.add("-1"); + row1.add("-1"); + row2.add("-1"); + row2.add("-1"); + matrix = new ArrayList>(); + matrix.add(row1); + matrix.add(row2); + } + public ArrayList> getMatrix() + { + return matrix; + } + public void setMatrixC(ArrayList> matrix) + { + this.matrix = matrix; + } + + + + +} diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/beans/MatrixOperations.java b/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/beans/MatrixOperations.java new file mode 100644 index 0000000..659348f --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/beans/MatrixOperations.java @@ -0,0 +1,87 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package edu.slcc.asdv.beans; + +import jakarta.inject.Named; +import jakarta.faces.view.ViewScoped; +import jakarta.inject.Inject; +import java.io.Serializable; +import java.math.BigInteger; +import java.util.ArrayList; + +/** + * + * @author A. V. Markou + */ +@Named(value = "matrixOperations") +@ViewScoped +public class MatrixOperations implements Serializable +{ + + @Inject + MatrixBeanA matrixA; + @Inject + MatrixBeanB matrixB; + + @Inject + MatrixBeanC matrixC; + + edu.slcc.asdv.bl.Matrices matrixManipulator = new edu.slcc.asdv.bl.Matrices(); + + public String add(){ + ArrayList> a = convertToBigInteger(matrixA.getMatrix()); + ArrayList> b = convertToBigInteger(matrixA.getMatrix()); + ArrayList> c = new ArrayList>(); + c = convertToString(matrixManipulator.addParallel(a, b)); + matrixC.setMatrixC( c ); + return ""; + } + + public String multiply() { + ArrayList> a = convertToBigInteger(matrixA.getMatrix()); + ArrayList> b = convertToBigInteger(matrixA.getMatrix()); + ArrayList> c = new ArrayList>(); + c = convertToString(matrixManipulator.multiplyParallel(a, b)); + matrixC.setMatrixC( c ); + return "";} + + + public MatrixBeanC getMatrixC(){return this.matrixC;} + + public MatrixBeanA getMatrixA(){return matrixA;} + + public MatrixBeanB getMatrixB(){return matrixB;} + + public ArrayList> convertToBigInteger(ArrayList> matrix) { + ArrayList> bigInt2DArray = new ArrayList<>(); + + for (int i = 0; i < matrix.size(); i++) { + ArrayList columnArray = new ArrayList(); + for (int j = 0; j < matrix.get(i).size(); j++) { + String cellValue = matrix.get(i).get(j); + columnArray.add(new BigInteger(cellValue)); + } + bigInt2DArray.add(columnArray); + } + + return bigInt2DArray; + } + + public ArrayList> convertToString(ArrayList> matrix) { + int numRows = matrix.size(); + int numCols = matrix.get(0).size(); + ArrayList> string2DArray = new ArrayList<>(); + for (int i = 0; i < matrix.size(); ++i) { + ArrayList columnArray = new ArrayList<>(); + for (int j = 0; j < matrix.get(i).size(); ++j) { + BigInteger cellValue = matrix.get(i).get(j); + columnArray.add(cellValue.toString()); + } + string2DArray.add(columnArray); + } + return string2DArray; + } + +} diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/beans/MenuBar.java b/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/beans/MenuBar.java new file mode 100644 index 0000000..d9fb89e --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/beans/MenuBar.java @@ -0,0 +1,78 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/JSF/JSFManagedBean.java to edit this template + */ +package edu.slcc.asdv.beans; + +import jakarta.faces.application.FacesMessage; +import jakarta.faces.application.FacesMessage.Severity; +import jakarta.faces.context.FacesContext; +import jakarta.inject.Named; +import jakarta.faces.view.ViewScoped; +import jakarta.inject.Inject; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import org.primefaces.PrimeFaces; + +@Named(value = "menuBar") +@ViewScoped +public class MenuBar implements Serializable +{ + @Inject + MatrixOperations matrixOperations; + private List> menus = new ArrayList>(); + + public void add() + { + System.out.println("menu add was called"); + + System.out.println("menu bar add()"); + matrixOperations.add();///adition of matrices + System.out.println(matrixOperations.getMatrixC()); + + List idsC = new ArrayList(); + idsC.add("formC"); + idsC.add("formC:datatableC"); + idsC.add("formC:datatableC:columnsC"); + idsC.add("formC:datatableC:columnsC:inputTextC"); + //idsC.add("form-menu");//:menuBar:submenu_matrices:menuitem_add"); + PrimeFaces.current().ajax().update(idsC); + + } + + public void multiply() + { + System.out.println("menu multiply was called"); + + System.out.println("menu bar multiply()"); + matrixOperations.multiply();///adition of matrices + System.out.println(matrixOperations.getMatrixC()); + + List idsC = new ArrayList(); + idsC.add("formC"); + idsC.add("formC:datatableC"); + idsC.add("formC:datatableC:columnsC"); + idsC.add("formC:datatableC:columnsC:inputTextC"); + //idsC.add("form-menu");//:menuBar:submenu_matrices:menuitem_add"); + PrimeFaces.current().ajax().update(idsC); + } + + public void subtract() + { + message( + FacesMessage.SEVERITY_INFO, + "Not implemented.", "To be implemented." + ); + } + + + + + + public void message(Severity severity, String msg, String msgDetails) + { + FacesMessage m = new FacesMessage(severity, msg, msgDetails); + FacesContext.getCurrentInstance().addMessage("msg", m); + } +} diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/bl/Matrices.java b/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/bl/Matrices.java new file mode 100644 index 0000000..cdc428a --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/bl/Matrices.java @@ -0,0 +1,265 @@ +package edu.slcc.asdv.bl; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.concurrent.ForkJoinPool; +import java.util.concurrent.RecursiveTask; + +/** + * + * @author A. V. Markou + */ +public class Matrices implements Matrix +{ + + + @Override + public ArrayList> addParallel(ArrayList> A, ArrayList> B) + { + RecursiveTask>> rt + = new Matrices.MatricesAddition(0, A.size() - 1, A, B); + ForkJoinPool pool = new ForkJoinPool(); + ArrayList> result = pool.invoke(rt); + return result; + } + + @Override + public ArrayList> multiplyParallel(ArrayList> A, ArrayList> B) + { + RecursiveTask>> rt + = new Matrices.MatricesMultiplication(0, A.size() - 1, A, B); + ForkJoinPool pool = new ForkJoinPool(); + ArrayList> result = pool.invoke(rt); + return result; + } + + + + + + + static class MatricesAddition extends RecursiveTask>> + { + + ArrayList> A; + ArrayList> B; + ArrayList> AplusB; + final int HOW_MANY_ROWS_IN_PARALLEL = 100;//threshold + int startIndex; + int endIndex; + + public MatricesAddition(int startIndex, int endIndex, + ArrayList> A, + ArrayList> B) + { + this.startIndex = startIndex;//start at this row of the matrix + this.endIndex = endIndex;//end at this row of the matrix + this.A = A; + this.B = B; + AplusB = new ArrayList>(); + + } + + @Override + protected ArrayList> compute() + { + //>>This is the addition of matrices in the IF. + //That is, HOW_MANY_ROWS_IN_PARALLEL from matrix A and HOW_MANY_ROWS_IN_PARALLEL from matrix B + if (this.endIndex - this.startIndex < HOW_MANY_ROWS_IN_PARALLEL) + { + ArrayList> resultC = new ArrayList>(); + for (int i = this.startIndex; i <= this.endIndex; ++i) + { + //>create a new row to add it to the resulting matrix resultC + ArrayList rowAplusB = new ArrayList(); + + for (int j = 0; j < A.get(0).size(); j++) + + //>get the Ith row from A and the Ith row from B and + //and add all the Jth entries from each row + { + BigInteger x = A.get(i).get(j); + BigInteger y = B.get(i).get(j); + BigInteger z = x.add(y); + + rowAplusB.add(z); + } + resultC.add(rowAplusB); + } + return resultC; + } + else + { //>> keep on FORKING the matrix until the + //side of the matric is equal or less to HOW_MANY_ROWS_IN_PARALLEL + + int mid = (this.endIndex + this.startIndex) / 2; + RecursiveTask>> firstHalf + = new MatricesAddition(this.startIndex, mid, A, B); + + RecursiveTask>> secondHalf + = new MatricesAddition(mid + 1, this.endIndex, A, B); + + firstHalf.fork();//this line will invoke method compute + secondHalf.fork();///this line will invoke method compute + + //>> join what the FORKs returned from the IFs + AplusB.addAll(firstHalf.join()); + AplusB.addAll(secondHalf.join()); + + return AplusB; + } + } + + } + + /** + * Multiples two lists one 1-t01 correspondence, that is the 1st element of + * the first list is multiplied with 1st elements of the second list and so + * on + * + * @param list1 + * @param list2 + * @return the multiplied results + */ + public static ArrayList multiplyLists(ArrayList list1, ArrayList list2) + { + ArrayList resultsOfMultiplications = new ArrayList(); + for (int bi = 0; bi < list1.size(); + ++bi) + { + resultsOfMultiplications.add(list1.get(bi).multiply(list2.get(bi))); + } + return resultsOfMultiplications; + } + + public static ArrayList> columnMajorOrderReversal(ArrayList> b) + { + ArrayList> tranformed = new ArrayList>(); + for (int column = 0; + column < b.get(0).size(); + ++column) + { + ArrayList rowTrandormedToColmn = new ArrayList(); + for (int row = 0; + row < b.size(); + ++row) + { + BigInteger bd = b.get(row).get(column); + rowTrandormedToColmn.add(bd); + } + tranformed.add(rowTrandormedToColmn); + } + + return tranformed; + } + + /** + * Adds a list of Big Decimals and returns the result of the addition. + * + * @param list - list of BigDecimal type + * @return the sum of the list + */ + public static BigInteger add(ArrayList list) + { + BigInteger bd = BigInteger.ZERO; + for (int bi = 0; bi < list.size(); + bi++) + { + bd = bd.add(list.get(bi)); + } + return bd; + } + + static class MatricesMultiplication extends RecursiveTask>> + { + + ArrayList> A; + ArrayList> B; + ArrayList> AxB; + final int HOW_MANY_ROWS_IN_PARALLEL = 3;//threshold + int startIndex; + int endIndex; + + public MatricesMultiplication(int startIndex, int endIndex, + ArrayList> A, + ArrayList> B) + { + this.startIndex = startIndex;//start at this row of the matrix + this.endIndex = endIndex;//end at this row of the matrix + this.A = A; + this.B = B; + AxB = new ArrayList>(); + + } + + /** + * matrix + * 1, 2, 3 + * 4, 5, 6 + * + * will be transformed to + * 1, 4 + * 2, 5 + * 3, 6 + * + * @param list + * @return + */ + @Override + protected ArrayList> compute() + { + //>>This is the addition of matrices in the IF. + //That is, HOW_MANY_ROWS_IN_PARALLEL from matrix A and HOW_MANY_ROWS_IN_PARALLEL from matrix B + if (this.endIndex - this.startIndex < HOW_MANY_ROWS_IN_PARALLEL) + { + ArrayList> resultC = new ArrayList>(); + ArrayList> bTransformed = columnMajorOrderReversal(B); + + for (int biA = this.startIndex; + biA <= this.endIndex; + ++biA) + { + ArrayList rowA = A.get(biA); + ArrayList rowAxB = new ArrayList(); + ArrayList rowCalculation = new ArrayList(); + for (int biB = 0; + biB < bTransformed.size(); + ++biB) + { + ArrayList rowB = bTransformed.get(biB); + + ArrayList productsOfRow = multiplyLists(rowA, rowB); + BigInteger sumOfRow = add(productsOfRow); + rowCalculation.add(sumOfRow); + + } + resultC.add(rowCalculation); + + } + return resultC; + } + else + { //>> keep on FORKING the matrix until the + //side of the matric is equal or less to HOW_MANY_ROWS_IN_PARALLEL + + int mid = (this.startIndex + this.endIndex) / 2; + RecursiveTask>> firstHalf + = new MatricesMultiplication(this.startIndex, mid, A, B); + + RecursiveTask>> secondHalf + = new MatricesMultiplication(mid + 1, this.endIndex, A, B); + + firstHalf.fork();//this line will invoke method compute + secondHalf.fork();///this line will invoke method compute + + //>> join what the FORKs returned from the IFs + AxB.addAll(firstHalf.join()); + AxB.addAll(secondHalf.join()); + + return AxB; + } + } + + } + +} diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/bl/Matrix.java b/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/bl/Matrix.java new file mode 100644 index 0000000..fd06101 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/bl/Matrix.java @@ -0,0 +1,19 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Interface.java to edit this template + */ +package edu.slcc.asdv.bl; + +import java.math.BigInteger; +import java.util.ArrayList; + +/** + * + * @author ASDV1 + */ +public interface Matrix +{ + ArrayList> addParallel(ArrayList> A, ArrayList> B); + ArrayList> multiplyParallel(ArrayList> A, ArrayList> B); + +} diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/resources/JakartaEE9Resource.java b/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/resources/JakartaEE9Resource.java new file mode 100644 index 0000000..01484d3 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/resources/JakartaEE9Resource.java @@ -0,0 +1,20 @@ +package edu.slcc.asdv.resources; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.Response; + +/** + * + * @author + */ +@Path("jakartaee9") +public class JakartaEE9Resource { + + @GET + public Response ping(){ + return Response + .ok("ping Jakarta EE") + .build(); + } +} diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/utilities/Utilities.java b/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/utilities/Utilities.java new file mode 100644 index 0000000..9642482 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/java/edu/slcc/asdv/utilities/Utilities.java @@ -0,0 +1,123 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template + */ +package edu.slcc.asdv.utilities; + + +import jakarta.el.ELContext; +import jakarta.el.ELResolver; +import jakarta.faces.application.Application; +import jakarta.faces.application.FacesMessage; +import jakarta.faces.component.UIComponent; +import jakarta.faces.context.FacesContext; +import java.math.BigInteger; +import java.util.ArrayList; + + +public class Utilities +{ + + public static UIComponent findComponent(String id) + { + + UIComponent result = null; + UIComponent root = FacesContext.getCurrentInstance().getViewRoot(); + if (root != null) + { + result = findComponent(root, id); + } + return result; + + } + + public static UIComponent findComponent(UIComponent root, String id) + { + + UIComponent result = null; + if (root.getId().equals(id)) + { + return root; + } + + for (UIComponent child : root.getChildren()) + { + if (child.getId().equals(id)) + { + result = child; + break; + } + result = findComponent(child, id); + if (result != null) + { + break; + } + } + return result; + + } + + public static void printIDs(UIComponent component) + { + System.out.println("\n\nPARENT ID " + component.getId()); + + if (component.getChildren() == null) + { + return; + } + + for (UIComponent child : component.getChildren()) + { + System.out.println("\t\tCHILD ID " + child.getId()); + + printIDs(child); + + } + } + +public static boolean isNumberOrDecimal( String s ) +{ + System.out.println("isNumberOrDecimal called " + s); + //[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+) + String regx = "^[+-]?(\\d*\\.)?\\d+$"; + return s.matches(regx); + +} + public static void message( FacesMessage.Severity severity, String msg, String msgDetails) + { + FacesMessage m = new FacesMessage(severity, msg, msgDetails); + FacesContext.getCurrentInstance().addMessage("msg", m); + } + + + public static T getCDIBean(String nameOfTheBean) + { + ELContext elc = FacesContext.getCurrentInstance().getELContext(); + FacesContext fc = FacesContext.getCurrentInstance(); + Application ap = fc.getApplication(); + ELResolver elr = ap.getELResolver(); + return (T) elr.getValue(elc, null, nameOfTheBean); + } + + + public static ArrayList> convertBigIntegerToString(ArrayList> matrix) + { + ArrayList> stringMatrix = new ArrayList>(); + + for (ArrayList row : matrix) + { + ArrayList stringRow = new ArrayList(); + for (BigInteger bigInt : row) + { + stringRow.add(new String(bigInt.toString())); + + } + stringMatrix.add(stringRow); + } + return stringMatrix; + } + + + + +} diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/resources/META-INF/persistence.xml b/Semester 3/Assignments/templatesMatricesSample/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..7582bf1 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/WEB-INF/beans.xml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 0000000..a0cd39d --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/WEB-INF/beans_1.xml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/WEB-INF/beans_1.xml new file mode 100644 index 0000000..a0cd39d --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/WEB-INF/beans_1.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/WEB-INF/faces-config.xml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/WEB-INF/faces-config.xml new file mode 100644 index 0000000..6618884 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/WEB-INF/faces-config.xml @@ -0,0 +1,15 @@ + + + + + com.pap.messages.messages + msgs + + + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/WEB-INF/glassfish-resources.xml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/WEB-INF/glassfish-resources.xml new file mode 100644 index 0000000..708a7d0 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/WEB-INF/glassfish-resources.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/WEB-INF/glassfish-web.xml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/WEB-INF/glassfish-web.xml new file mode 100644 index 0000000..673cc06 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/WEB-INF/glassfish-web.xml @@ -0,0 +1,25 @@ + + + + + + + + Keep a copy of the generated servlet class' java code. + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/WEB-INF/web.xml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..7473658 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,40 @@ + + + + jakarta.faces.PROJECT_STAGE + Development + + + Faces Servlet + jakarta.faces.webapp.FacesServlet + 1 + + + ServletExcel + edu.slcc.asdv.servlets.ServletExcel + + + TestServlet + edu.slcc.asdv.servlets.TestServlet + + + ServletExcel + /ServletExcel + + + Faces Servlet + /faces/* + + + TestServlet + /TestServlet + + + + 30 + + + + faces/index.xhtml + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/index.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/index.xhtml new file mode 100644 index 0000000..3018965 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/index.xhtml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + Application Software Development, SLCC + + + + Templates, and Menus Illustration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ASDV 2800 , Templates + + +
+
+ + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/login-n-search/login.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/login-n-search/login.xhtml new file mode 100644 index 0000000..e5b3f6c --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/login-n-search/login.xhtml @@ -0,0 +1,25 @@ + + + + + Login + > + + + + + + + + + + + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/login-n-search/search.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/login-n-search/search.xhtml new file mode 100644 index 0000000..21586b9 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/login-n-search/search.xhtml @@ -0,0 +1,21 @@ + + + + + Login + > + + + + + + + + + + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/matrices/compose.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/matrices/compose.xhtml new file mode 100644 index 0000000..900ea85 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/matrices/compose.xhtml @@ -0,0 +1,26 @@ + + + + + Facelet Title + + + + + + + + + + + + + + + + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/matrices/matrixA.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/matrices/matrixA.xhtml new file mode 100644 index 0000000..2af9005 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/matrices/matrixA.xhtml @@ -0,0 +1,51 @@ + + + + + MatriX A + + + + + + + + + + + Matrix A + + + + + + + + + + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/matrices/matrixB.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/matrices/matrixB.xhtml new file mode 100644 index 0000000..c6c5176 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/matrices/matrixB.xhtml @@ -0,0 +1,48 @@ + + + + + MatriX A + + + + + + + + Matrix B + + + + + + + + + + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/matrices/matrixC.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/matrices/matrixC.xhtml new file mode 100644 index 0000000..958d8a5 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/matrices/matrixC.xhtml @@ -0,0 +1,47 @@ + + + + + MAtrix C + + + + + + + + Matrix C + + + + + + + + + + + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/matrices/menuMatrices.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/matrices/menuMatrices.xhtml new file mode 100644 index 0000000..b5229db --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/matrices/menuMatrices.xhtml @@ -0,0 +1,39 @@ + + + + + Menu + + + + + + + + + + + + + + + + + + + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/bottomStyle.css b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/bottomStyle.css new file mode 100644 index 0000000..eeca699 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/bottomStyle.css @@ -0,0 +1,18 @@ +#bottom { + margin: 0px 0px 0px 0px; + text-align:center; + color: #ffffff; + + background-image: -webkit-gradient( + linear, + left top, + left bottom, + color-stop(0, blue), + color-stop(1, blue) + ); + background-image: -o-linear-gradient(bottom, blue 0%, #120205 100%); + background-image: -moz-linear-gradient(bottom, blue 0%, #120205 100%); + background-image: -webkit-linear-gradient(bottom, blue 0%, #120205 100%); + background-image: -ms-linear-gradient(bottom, blue 0%, #120205 100%); + background-image: linear-gradient(to bottom, blue 0%, #120205 100%); +} diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/contentStyle.css b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/contentStyle.css new file mode 100644 index 0000000..f505a90 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/contentStyle.css @@ -0,0 +1,3 @@ +#content { + background: white; +} diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/cssLayout.css b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/cssLayout.css new file mode 100644 index 0000000..4b6e5ff --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/cssLayout.css @@ -0,0 +1,50 @@ +#wrapper { + margin-left:auto; + margin-right:auto; +} + +#title { + position: relative; + margin: 1px 0px 0px 0px; +} + +#login_and_search { + position: relative; + margin: 0px 0px 5px 0px; +} + +#login { + float: left; + position: relative; +} + +#search { + float: right; + position: relative; +} + +#top { + position: relative; + overflow: hidden; +} + +#bottom { + position: relative; +} + +#left { + float: left; +} + +#logo { + float: left; +} + +#right { + float: right; +} + +#content { + overflow: hidden; +} + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/dataTable.css b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/dataTable.css new file mode 100644 index 0000000..8b0bacf --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/dataTable.css @@ -0,0 +1,237 @@ + +.rowNumber{ + + margin-right:20px; + width : 100px; + background: blue; + font-family: Impact; + font-size: 1.2em; + color: white; +} + +body .ui-datatable .ui-paginator { + position: relative; + text-align: left; + bottom: 0px; + width: inherit; + padding: 2px; + z-index: 1; +} + + +.input { + font-size: 1em; + max-width: 35px; + min-width: 35px; + height : 35px; + font-size: 1em; + font-family: inherit; + background-color: #fff; + border: solid 1px; + + border-color: blueviolet; + border-radius: 4px; +} + +.dataTables { + overflow-y:scroll; + overflow-x:scroll; + + + height : 386px; + width: 300px; + display:block; + background-color: #fff; + + zoom: 1; +} + +.ui-datatable table{ + border-collapse:collapse; + width:100%; +} +.ui-datatable.ui-datatable-header,.ui-datatable.ui-datatable-footer{ + text-align:center; + padding:4px 10px; + +} +.ui-datatable.ui-datatable-header{ + border-bottom:0px none; + +} +.ui-datatable.ui-datatable-footer{ + border-top:0px none; +} +.ui-datatable thead th +{ + font-family: Arial; + font-size: 1.2em; + color: blue; + background: white; +} +.ui-datatable thead td +{ + font-family: Impact; + font-size:1.2em; + color: blue; +} +.ui-datatable tfoot td{ + text-align:center; +} +ui-datatable thead th +{ + overflow:hidden; +} +.ui-datatable tbody td , .ui-datatable tfoot td{ + padding:4px 10px; + overflow:hidden; + white-space:nowrap; + border-width:1px; + border-style:solid; +} +.ui-datatable tbody tr +{ + clear: both; +} + +.ui-datatable .ui-sortable-column{ + cursor:pointer; +} +.ui-datatable div.ui-dt-c{ + position:relative; +} +.ui-datatable .ui-sortable-column-icon{ + display:inline-block; + margin:-3px 0px -3px 2px; +} +.ui-datatable .ui-column-filter{ + display:block; + width:100px; + margin:auto; +} +.ui-datatable .ui-expanded-row{ + border-bottom:0px none; +} +.ui-datatable .ui-expanded-row-content{ + border-top:0px none; +} +.ui-datatable .ui-row-toggler{ + cursor:pointer; +} +.ui-datatable tr.ui-state-highlight{ + cursor:pointer; +} +.ui-datatable .ui-selection-column .ui-chkbox-all{ + display:block; + margin:0px auto; + width:16px; + height:16px; +} +.ui-datatable-scrollable table{ + table-layout:auto; +} +.ui-datatable-scrollable-body{ + overflow:auto; +} +.ui-datatable-scrollable-header,.ui-datatable-scrollable-footer{ + overflow:hidden; + border:0px none; +} +.ui-datatable-scrollable .ui-datatable-scrollable-header,.ui-datatable-scrollable .ui-datatable-scrollable-footer{ + position:relative; +} +.ui-datatable-scrollable .ui-datatable-scrollable-header td{ + font-weight:normal; +} +.ui-datatable-scrollable-body::-webkit-scrollbar{ + -webkit-appearance:none; + width:15px; + background-color:transparent; +} +.ui-datatable-scrollable-body::-webkit-scrollbar-thumb{ + border-radius:8px; + border:1px solid white; + background-color:rgba(194,194,194,.5); +} +.ui-datatable .ui-datatable-data tr.ui-state-hover{ + border-color:inherit; + font-weight:inherit; + cursor:pointer; +} +.ui-datatable .ui-paginator,.ui-datatable .ui-paginator{ + padding:2px; +} +.ui-column-dnd-top, ui-column-dnd-bottom{ + display:none; + position:absolute; +} +.ui-column-dnd-top .ui-icon, ui-column-dnd-bottom .ui-icon{ + position:absolute; + top:-4px; +} +/* InCell Editing */.ui-datatable .ui-cell-editor-input{ + display:none; +} +.ui-datatable .ui-row-editing .ui-cell-editor .ui-cell-editor-output{ + display:none; +} +.ui-datatable .ui-row-editing .ui-cell-editor .ui-cell-editor-input{ + display:block; +} +.ui-datatable .ui-row-editor span{ + cursor:pointer; + display:inline-block; +} +.ui-datatable .ui-row-editor .ui-icon-pencil{ + display:inline-block; +} +.ui-datatable .ui-row-editing .ui-row-editor .ui-icon-pencil{ + display:none; +} +.ui-datatable .ui-row-editor .ui-icon-check,.ui-datatable .ui-row-editor .ui-icon-close{ + display:none; +} +.ui-datatable .ui-row-editing .ui-row-editor .ui-icon-check,.ui-datatable .ui-row-editing .ui-row-editor .ui-icon-close{ + display:inline-block; +} +.ui-datatable .ui-datatable-data tr.ui-row-editing td.ui-editable-column,.ui-datatable .ui-datatable-data td.ui-cell-editing{ + padding:0; + margin:0; +} +/*resizer */.ui-datatable .ui-column-resizer{ + width:8px; + height:20px; + padding:0px; + cursor:col-resize; + background-image:url("/ScraperOnWeb/javax.faces.resource/spacer/dot_clear.gif.jsf?ln=primefaces"); + margin:-4px -10px -4px 0px; + float:right; +} +.ui-datatable .ui-filter-column .ui-column-resizer{ + height:45px; +} +.ui-datatable .ui-column-resizer-helper{ + width:1px; + position:absolute; + z-index:10; + display:none; +} +.ui-datatable-resizable{ + padding-bottom:1px;/*fix for webkit overlow*/ + overflow:auto; +} +.ui-datatable-resizable table{ + table-layout:auto; +} +.ui-datatable-rtl{ + direction:rtl; +} +.ui-datatable-rtl.ui-datatable thead th, .ui-datatable-rtl.ui-datatable tfoot td{ + text-align:right; +} + + + + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/default.css b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/default.css new file mode 100644 index 0000000..0c5e67f --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/default.css @@ -0,0 +1,8 @@ + +body { + background-color: #ffffff; + font-size: 12px; + font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + color: #000000; + margin: 2px; +} diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/imageZoomStyle.css b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/imageZoomStyle.css new file mode 100644 index 0000000..8aa00a0 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/imageZoomStyle.css @@ -0,0 +1,34 @@ + +* {box-sizing: border-box;} + +.img-zoom-container { + position: relative; +} + +.img-zoom-lens { + position: absolute; + /*set the size of the lens:*/ + width: 40px; + height: 40px; +} + +.img-zoom-result { + + /*border: 5px solid #000000;*/ + /*set the size of the result div:*/ + width: 300px; + height: 300px; +} +.myDiv +{ + align: center; + padding: 30px; + margin: 10; + border-left: 10px solid navy; +} + +.hpanel{ + position: relative; + top: 0px; left: 0px; +} + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/leftStyle.css b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/leftStyle.css new file mode 100644 index 0000000..aaafa7d --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/leftStyle.css @@ -0,0 +1,22 @@ +#left { + + background-image: -webkit-gradient( + linear, + left top, + left bottom, + color-stop(0, #2D4A37), + color-stop(1, #789480) + ); + background-image: -o-linear-gradient(bottom, #2D4A37 0%, #789480 100%); + background-image: -moz-linear-gradient(bottom, #2D4A37 0%, #789480 100%); + background-image: -webkit-linear-gradient(bottom, #2D4A37 0%, #789480 100%); + background-image: -ms-linear-gradient(bottom, #2D4A37 0%, #789480 100%); + background-image: linear-gradient(to bottom, #2D4A37 0%, #789480 100%); + -moz-box-shadow: 0px 0px 15px 3px #333333; + -webkit-box-shadow: 0px 0px 15px 3px #333333; + box-shadow: 0px 0px 15px 3px #333333; + + text-align:left; + padding-left:10px; + margin-right: 5px; +} diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/loginStyle.css b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/loginStyle.css new file mode 100644 index 0000000..2849107 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/loginStyle.css @@ -0,0 +1,65 @@ +.inputs { + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + background-color: #00f; + background: -moz-linear-gradient(top, #FFF, #EAEAEA); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0.0, #FFF), color-stop(1.0, #EAEAEA)); + border: 1px solid #CACACA; + color: #444; + font-size: 1.1em; + margin: 0px 10px 0px 0px; + padding-left: 2px; + width:200px; +} +.inputs:focus { + color: #ffffff; + background: #0000cc; + -webkit-box-shadow: 0 0 25px #CCC; + -moz-box-shadow: 0 0 25px #cccc00; + box-shadow: 0 0 25px #CCCC00; + -webkit-transform: scale(1.05); + -moz-transform: scale(1.05); + transform: scale(1.05); +} + +.lbutton { + -moz-box-shadow: 4px 7px 13px -7px #276873; + -webkit-box-shadow: 4px 7px 13px -7px #276873; + box-shadow: 4px 7px 13px -7px #276873; + background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #171717), color-stop(1, #d92323)); + background:-moz-linear-gradient(top, #171717 5%, #222 100%); + background:-webkit-linear-gradient(top, #171717 5%, #222 100%); + background:-o-linear-gradient(top, #171717 5%, #222 100%); + background:-ms-linear-gradient(top, #171717 5%, #222 100%); + background:linear-gradient(to bottom, #171717 5%, #222 100%); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#171717', endColorstr='#d92323',GradientType=0); + background-color:#222; + -moz-border-radius:17px; + -webkit-border-radius:17px; + border-radius:17px; + display:inline-block; + cursor:pointer; + color:#ffffff; + font-family:arial; + font-size:12px; + font-weight:bold; + padding:2px 12px; + text-decoration:none; + text-shadow:0px 1px 0px #3d768a; +} +.lbutton:hover { + background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #222), color-stop(1, #171717)); + background:-moz-linear-gradient(top, #00f 5%, #222 100%); + background:-webkit-linear-gradient(top, 00f 5%, #222 100%); + background:-o-linear-gradient(top, #00f 5%, #222 100%); + background:-ms-linear-gradient(top, #00f 5%, #222 100%); + background:linear-gradient(to bottom, #00f 5%, #222 100%); + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#d92323', endColorstr='#222',GradientType=0); + background-color:#00f; +} +.lbutton:active { + position:relative; + top:1px; +} + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/login_and_searchStyle.css b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/login_and_searchStyle.css new file mode 100644 index 0000000..b35091d --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/login_and_searchStyle.css @@ -0,0 +1,8 @@ +#login_and_search { + + width:100%; + height:90px; + background-color: white; + padding: 20px; + display: inline-block; +} diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/logoStyle.css b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/logoStyle.css new file mode 100644 index 0000000..83870d2 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/logoStyle.css @@ -0,0 +1,9 @@ +#logo { + background-image : url("#{resource['images/owl.png']}") ; + background-repeat: no-repeat; + margin-right: 0px; + width:60px; + height:60px; + float: left; + +} diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/menuStyle.css b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/menuStyle.css new file mode 100644 index 0000000..a68d788 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/menuStyle.css @@ -0,0 +1,37 @@ +#menu { + white-space: nowrap; + height: 28px; + width:100%; + background: #fff url("#{resource['images/menu.png']}") bottom center ; + margin-bottom: 5px; +} + +#menu ul { + margin: 0; + padding: 0; + list-style:none; + float:left; +} + +#menu li { + float: left; + margin: 0 3px 0 3px; + padding: 0; + background: transparent; +} + +#menu a { + font-family: Arial, Helvetica, sans-serif; + font-size: 15px; + font-weight: normal; + float:left; + display:block; + height: 26px; + line-height: 24px; + padding: 2px 10px 0 10px; + color: #cccc00; + text-decoration: none; + background: transparent; + +} + \ No newline at end of file diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/rightStyle.css b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/rightStyle.css new file mode 100644 index 0000000..4c5502a --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/rightStyle.css @@ -0,0 +1,5 @@ +#right { + background-color: #FA0519; + text-align:center; + margin-left: 5px; +} diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/searchStyle.css b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/searchStyle.css new file mode 100644 index 0000000..57e52f1 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/searchStyle.css @@ -0,0 +1,3 @@ +#search { + color: #ffffff; +} diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/stylesLinks.css b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/stylesLinks.css new file mode 100644 index 0000000..eef30a3 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/stylesLinks.css @@ -0,0 +1,67 @@ + +a { + font-family: Arial, Helvetica, sans-serif; + font-size: 15px; + font-weight: normal; + float:left; + display:block; + height: 26px; + line-height: 24px; + padding: 2px 10px 0 10px; + color: #cccc00; + text-decoration:#A3979A; + background-color: white; + border: white; + padding: 0px +} +a.hover { + float: left; + font-family: Arial, Helvetica, sans-serif; + font-size: 15px; + font-weight: normal; + float:left; + display:block; + height: 26px; + line-height: 24px; + color: #cccc00; + text-decoration: none; + + background-color: white; + border: white; + padding: 0px +} + +.menus +{ + font-family: Arial, Helvetica, sans-serif; + font-size: 15px; + font-weight: normal; + float:right; + + + color: #cccc00; + text-decoration:#A3979A; + background-color: white; + border: white; + padding: 0px ; + margin-top: 0px; + margin-right: 0px; + margin-bottom: 0px; + margin-left: 0px; +} + + .affaires .ui-menuitem-text{color:#cccc00; + decoration: bold, italic; + + } + .affaires .ui-menu-child{background: white; mouseover: #000; + background-color: #A80000;} + .affaires .ui-menubar{mouseover: #000; + background-color: #A80000;} + .affaires .ui-state-hover {} + + a.active { + color: #D09d23; + font-weight: bold; + background-color : #c7c3c3; +} \ No newline at end of file diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/titleStyle.css b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/titleStyle.css new file mode 100644 index 0000000..24b1112 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/titleStyle.css @@ -0,0 +1,9 @@ +#title { + background: white; + color:blue; + text-align:center; + font-size: 24px; + font-weight: bold; +} + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/topStyle.css b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/topStyle.css new file mode 100644 index 0000000..63294a9 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/css/layout-css/topStyle.css @@ -0,0 +1,9 @@ +#top { + color: blue; + font-family: cursive, sans-serif; + font-size: 22px; + font-style: italic; + text-align: center; + height:60px; + background: white; +} diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/images/download.png b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/images/download.png new file mode 100644 index 0000000..b1315ca Binary files /dev/null and b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/images/download.png differ diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/images/owl.png b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/images/owl.png new file mode 100644 index 0000000..84fb6d0 Binary files /dev/null and b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/images/owl.png differ diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/js/do_validation.js b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/js/do_validation.js new file mode 100644 index 0000000..6e21513 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/js/do_validation.js @@ -0,0 +1,22 @@ + + + +function validateText(textInputID) +{ + var htmlInputText = document.getElementById(textInputID); + var text = htmlInputText.value; + + + var regex = /[^A-Za-z0-9]/g; + + if (text.search( regex) != -1) + { + newText = text.replace(regex, ""); + htmlInputText.value = newText; + //alert("alphanumeric chars only please"); + + } + +} + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/bottomDefault.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/bottomDefault.xhtml new file mode 100644 index 0000000..1925805 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/bottomDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + +

This is default footer

+
+
+ diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/contentDefault.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/contentDefault.xhtml new file mode 100644 index 0000000..81c4495 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/contentDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + This is default content + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/leftDefault.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/leftDefault.xhtml new file mode 100644 index 0000000..1e7e628 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/leftDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + This is default left side + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/loginDefault.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/loginDefault.xhtml new file mode 100644 index 0000000..b1dd7a8 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/loginDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + Default Login Section + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/logoDefault.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/logoDefault.xhtml new file mode 100644 index 0000000..54103c8 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/logoDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + LOGO + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/menuDefault.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/menuDefault.xhtml new file mode 100644 index 0000000..f244225 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/menuDefault.xhtml @@ -0,0 +1,14 @@ + + + + + + + Menu default + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/rightDefault.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/rightDefault.xhtml new file mode 100644 index 0000000..9aabcc8 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/rightDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + This is default right side + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/searchDefault.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/searchDefault.xhtml new file mode 100644 index 0000000..80b6c4b --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/searchDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + Default Search Section + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/titleDefault.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/titleDefault.xhtml new file mode 100644 index 0000000..7c9eeb4 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/titleDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + + This is default title + + + diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/topDefault.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/topDefault.xhtml new file mode 100644 index 0000000..f1b76a0 --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/default/topDefault.xhtml @@ -0,0 +1,12 @@ + + + + + + +

This is default header

+
+
+ diff --git a/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/generic/generic-layout.xhtml b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/generic/generic-layout.xhtml new file mode 100644 index 0000000..39934fa --- /dev/null +++ b/Semester 3/Assignments/templatesMatricesSample/src/main/webapp/resources/templates/generic/generic-layout.xhtml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + Generic Template + + +
+ +
+ + + +
+
+ +
+ + + +
+ + + +
+
+
+ + + + + + + + + +
+ + +
+ + + +
+
+ + + + + +
+ + + +
+
+ + +
+ +
+ + + +
+
+
+
+