diff --git a/.gitignore b/.gitignore index acd33e3..3cc75b9 100755 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ local.properties .settings/** .loadpath /src/main/resources/rebel.xml +/src/main/resources/config/application-dev.yml # External tool builders .externalToolBuilders/** diff --git a/bower.json b/bower.json index 602da26..5a8ee81 100755 --- a/bower.json +++ b/bower.json @@ -25,7 +25,8 @@ "modernizr": "2.8.3", "ng-file-upload": "7.0.17", "ngInfiniteScroll": "1.2.0", - "swagger-ui": "2.1.2" + "swagger-ui": "2.1.2", + "amcharts":"3.4.6" }, "devDependencies": { "angular-mocks": "1.4.5", diff --git a/pom.xml b/pom.xml index fb73859..a914342 100755 --- a/pom.xml +++ b/pom.xml @@ -382,7 +382,14 @@ ${cucumber.version} test - + + + org.ojalgo + ojalgo + 36.0 + + + spring-boot:run diff --git a/src/main/java/com/pri/cabzza/web/rest/CalculateResource.java b/src/main/java/com/pri/cabzza/web/rest/CalculateResource.java new file mode 100644 index 0000000..fe53e22 --- /dev/null +++ b/src/main/java/com/pri/cabzza/web/rest/CalculateResource.java @@ -0,0 +1,41 @@ +package com.pri.cabzza.web.rest; + +import com.codahale.metrics.annotation.Timed; + +import java.math.BigDecimal; + +import org.ojalgo.finance.portfolio.MarkowitzModel; +import org.ojalgo.matrix.BasicMatrix; +import org.ojalgo.matrix.PrimitiveMatrix; + +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; + +/** + * REST controller for managing Calculation. + */ +@RestController +@RequestMapping("/api") +public class CalculateResource { + + /** + * PUT /calculate/:id - calculating NewStockWallet mathematical values and related PortfolioStores + */ + @RequestMapping(value = "/calculate", + method = RequestMethod.PUT, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public void calculate() throws Exception { + + //just testing MarkovitzModel, will be change in the future + double[][] CArray = {{1.,0.,0.},{0.,0.5,0.},{0.,0.,1.}}; + double[][] RArray = {{1,0,-1}}; + BasicMatrix covariance = PrimitiveMatrix.FACTORY.rows(CArray); + BasicMatrix returns = PrimitiveMatrix.FACTORY.rows(RArray); + MarkowitzModel currentModel = new MarkowitzModel(covariance,returns); + currentModel.setShortingAllowed(false); + currentModel.setTargetReturn(BigDecimal.ZERO); + System.out.print(currentModel.getWeights()); + + } +} diff --git a/src/main/resources/config/application-dev.yml b/src/main/resources/config/application-dev.yml index 2817e9f..cff20fe 100755 --- a/src/main/resources/config/application-dev.yml +++ b/src/main/resources/config/application-dev.yml @@ -23,7 +23,7 @@ spring: url: jdbc:postgresql://localhost:5432/Cabzza name: username: postgres - password: + password: jpa: database-platform: com.pri.cabzza.domain.util.FixedPostgreSQL82Dialect database: POSTGRESQL diff --git a/src/main/scss/main.scss b/src/main/scss/main.scss index c94dc5e..c7e0fc7 100755 --- a/src/main/scss/main.scss +++ b/src/main/scss/main.scss @@ -4,10 +4,36 @@ $icon-font-path: "../../bower_components/bootstrap-sass/assets/fonts/bootstrap/" @import "bootstrap-sass/assets/stylesheets/_bootstrap.scss"; // endbower +/* load fonts */ +@font-face { + font-family: Lato-light; + src: url('../fonts/Lato-Light.ttf'); +} + +@font-face { + font-family: Lato-Bold; + src: url('../fonts/Lato-Bold.ttf'); +} + +@font-face { + font-family: Lato-Thin; + src: url('../fonts/Lato-Thin.ttf'); +} + +@font-face { + font-family: Lato-Regular; + src: url('../fonts/Lato-Regular.ttf'); +} +/* end of load fonts */ + body { background: #fafafa; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - color: #333; + font-family: "Lato-Light", Arial, sans-serif; + text-align: center; + color: rgba(119,34,17,1); + width: 100%; + height: auto; + min-height: 100%; } [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { @@ -150,4 +176,633 @@ ul#strength { margin: 0; } /* end of Custom alerts for notification */ +/* general styles for Cabzza */ +/* BUTTON */ + + +.btn-cabzza{ + -webkit-border-radius: 28; + -moz-border-radius: 28; + width: 100%; + border-radius: 28px; + font-family:'Lato-Regular'; + color: #ffffff; + font-size: 20px; + background: rgba(255,255,255,0); + padding: 5px 20px 5px 20px; + border: solid #ffffff 2px; + text-decoration: none; +} +.btn-invert{ + border: solid rgba(119,34,17,0.8) 2px; + background: rgba(255,255,255,0); + color: rgba(119,34,17,0.8); +} +.btn-cabzza:hover { + background: rgba(255,255,255,0.2); + text-decoration: none; + color: rgba(119,34,17,1); +} +.btn-invert:hover{ + background: rgba(119,34,17,0.3); +} +.buttons-row { + margin: 0; + padding-top: 5%; + padding-bottom: 5%; +} +@media(max-width:768px) { + .intro-section .btn { + width: 50%; + border-radius: 40px; + font-size: 15px; + padding: 10px 25px 10px 25px; + } + .buttons-row { + margin: 0; + padding-top: 5%; + padding-bottom: 5%; + } +} +/* end of BUTTON */ +/* CHECKBOX */ + +/* end of CHECKBOX */ +.nopadding { + padding: 0; + border: 0; +} +.container-fluid { + padding-bottom: 0; + margin: 0; +} +.navbar-default { + background: rgba(255,255,255,0.3); + border-bottom: none; + position: auto; +} +h1, h2, h3, h4, h5, h6, p { + margin-bottom: 0; + margin-top: 0; + padding: 0; + border: 0; +} +p, +textarea { + font-size: 10px; +} +h1 { + font-size: 90px; +} +h2{ + font-size: 50px; +} +h3 { + font-size: 30px; +} +h4 { + font-size: 22px; +} +h5 { + font-size: 18px; +} +h6, +small, +span { + font-size: 15px; +} + +@media(max-width:768px) { + p { + font-size: 10px; + } + h1 { + font-size: 90px; + } + h2{ + font-size: 50px; + } + h3 { + font-size: 30px; + } + h4 { + font-size: 20px; + } + h5 { + font-size: 15px; + } + h6 { + font-size: 10px; + } +} + +a { + margin-bottom: 0; + margin-top: 0; + font-size: 15px; + font-family:'Lato-Light'; + text-decoration: none; + text-align: center; + color: white; +} +a:hover { + text-decoration: none; + color: rgba(119,34,17,1); +} +i { + font-size: 40px; + padding-right: 5%; + padding-left: 5%; + padding-top: 10%; + color: white; +} +@media(max-width:768px) { + i { + font-size: 10%; + padding-right: 10%; + padding-left: 10%; + padding-top: 40%; + } +} +.input-style, +.input-style { + height: 50px; + width: 100%; + font-size: 18px; + background: rgba(0,0,0,0.05); + padding: 0 15px 0 15px; + margin: 10px 0 10px 0; + border: solid 1px white; + border-radius: 5px; + transition: box-shadow 0.2s; + -webkit-transition: box-shadow 0.2s; + outline: none; +} +@media(max-width:768px) { + +} +/* data/content boxes in login, register, steps */ +.content-box { + background: rgba(255,255,255,0.5); + height: auto; + margin-top: 0; + margin-bottom: 16.6667%; +} +.box-title { + padding-top: 8%; + padding-bottom: 5%; + text-align: center; +} +.inside-box { + margin: 5%; + padding-top: 5%; + padding-bottom: 2%; +} +@media(max-width:768px) { + .content-box { + margin-bottom: 8.3334%; + } + .box-title { + padding-top: 4%; + padding-bottom: 4%; + } +} +/* end of data/content boxes in login, register, steps */ +/* end of general styles for Cabzza */ +/* Custom styles for index /////////////////////////////////////////////////////////////*/ +/* intro section */ +.intro-section { + background-image: url('../IMG/background_m.jpg'); + background-size: cover; + padding-bottom: 3%; +} +#index-title { + padding-top: 10%; +} +#index-subtitle { + padding-bottom: 1%; +} +/* end of intro section */ +/* content section */ +.cabzza-background { + background-image: url('../IMG/background.png'); + background-size: cover; +} +.part-1, .part-2, .part-3 { + padding-top: 5%; + padding-bottom: 5%; +} +.part-1 .mac { + width: 100%; +} +.part-3 .ipad { + margin-left: 30%; + margin-top: 0%; + position: absolute; + width: 30vw; + height: 45vw; + overflow: hidden; + display: block; +} +.part-3 .iphone { + margin-left: 10%; + margin-top: 30%; + position: absolute; + width: 17vw; + height: 40vw; + overflow: hidden; + display: block; + z-index: 100; +} +.part-1 img { + overflow: hidden; + padding-top: 10%; + width: 120%; + margin: 0; + padding: 0; +} +.part-3 img { + width: 100%; + height: auto; + margin: 0; + padding: 0; +} +.part-1 .text-diff-height, +.part-3 .text-diff-height { + padding-top: 30%; + padding-left: 8% +} +.part-1 .text-diff-height h4, +.part-1 .text-diff-height h3, +.part-3 .text-diff-height h4, +.part-3 .text-diff-height h3 { + text-align: left; + color: rgba(119,34,17,1); + display: inline; + line-height: 100%; +} +.part-3 .text-diff-height h4, +.part-3 .text-diff-height h3 { + color: white; +} +.part-1 .text-diff-height h3, +.part-3 .text-diff-height h3 { + font-family:'Lato-Bold'; + line-height: 55%; +} + + @media(max-width:768px) { + .part-1 img { + padding-top: 0; + width: 140%; + } + .part-1 .text-diff-height, + .part-3 .text-diff-height { + padding-top: 0%; + padding-left: 0%; + padding-bottom: 10%; + text-align: center; + } + .part-3 .setheight { + height: auto; + position: relative; + } + + .part-3 .ipad { + left: 20%; + margin-left: 0%; + margin-top: 0%; + position: relative; + width: 55vw; + height: 80vw; + } + + .part-3 .iphone { + left: 10%; + margin-left: 0%; + margin-top: 0%; + position: absolute; + height: 50vw; + width: 25vw; + display: none; + } +} +.part-2 #column { + padding-left: 5%; + padding-right: 5%; + padding-bottom: 5%; +} + +.part-2 i { + font-size: 80px; + color: rgba(119,34,17,0.8); +} + +.part-2 h4 { + text-align: justify; +} + +.part-2 h3 { + text-align: center; + font-family: "Lato-Bold"; +} + @media(max-width:750px) { + + .part-2 i { + font-size: 50px; + color: rgba(119,34,17,0.2); + position: relative; + } + + .part-2 h6, h5 { + text-align: justify; + position: relative; + } + + .part-2 h5 { + text-align: right; + -ms-transform: rotate(-90deg); /* IE 9 */ + -webkit-transform: rotate(-90deg); /* Chrome, Safari, Opera */ + transform: rotate(-90deg); + } +} + +.part-3 .setheight{ + height: 45vw; + position: relative; +} + +@media(max-width:768px) { + + + .part-3 .setheight{ + height: auto; + position: relative; + } + + .part-3 .ipad { + left: 20%; + margin-left: 0%; + margin-top: 0%; + position: relative; + width: 55vw; + height: 80vw; + } + + .part-3 .iphone { + left: 10%; + margin-left: 0%; + margin-top: 0%; + position: absolute; + height: 50vw; + width: 25vw; + display: none; + } +} +/* end of content section */ +/* end of Custom styles for index */ +/* footer /////////////////////////////////////////////////////////////*/ +.footer { + height: 100%; + padding-top: 5%; + background-color: white; + text-align: left; +} +@media(max-width:750px) { + .footer h4, p { + text-align: center; + } + + .footer h4 { + text-align: center; + } +} +/* end of footer */ +/* register page / login page styles */ +#strengthBar { /* password strength bar */ + display: inline; + margin: 0; + +} +#strengthBar li.point { /* password strength bar */ + height: 10px; + border: solid rgba(119,34,17,0.6) 1px; +} +/* end of register page / login page styles */ +/*custom styles for steps/////////////////////////////////////////////////////////////*/ +/*buttons in steps for mobile*/ +@media(max-width:768px) { + .btn-next { + font-size: 12px; + margin-top: 10%; + text-transform: uppercase; + max-width: 70px; + padding-bottom: 4px; + z-index: 9999; + } + #btn-right { + float: right; + } +} +/*icon describing the state (growth, drop or no-change) of each of listed companies*/ +i.stateIcon { + display: inline-block; + margin: 0; + padding: 0; + width: 40px; + text-align: center; + font-size: 30px; +} +.stateIcon.fa-angle-double-up { + color: green; +} +.stateIcon.fa-angle-double-down { + color: red; +} +.stateIcon.fa-arrows-h { + color: blue; +} +@media(max-width:768px) { + i.stateIcon { + width: 30px; + font-size: 20px; + } +} +/*positioning of sliders and titles in step 4*/ +.row .row-padding { + padding-top: 2%; + padding-bottom: 2%; +} +.sliderPositioning { + padding-top: 2.5%; +} +@media(max-width:768px) { + .sliderPositioning { + padding-left: 0; + padding-right: 0; + } + .slider-horizontal { + vertical-align: middle; + } +} +/*date input styling for step 5*/ +i.dateIcon { + margin: 0; + padding: 0; + width: 30px; + text-align: left; + font-size: 25px; + color: rgba(119,34,17,1); +} +.input-append.date .add-on i { + display: inline-block; + width: 30px; + height: 40px; +} +.date-field { + display: inline-block; +} +.input-style.date-field { + height: 40px; + width: 40%; + padding: 5px; + text-align: center; +} +@media(max-width:768px) { + .step-box .input-style.date-field { + height: 40px; + width: 85%; + padding: 5px; + text-align: center; + } +} +/*custom style for dropdown-input*/ +.dropdown-input .btn { + width: 50px; + height: 50px; + background: rgba(0,0,0,0.3); + padding: 0; + border: solid #ffffff 1px; + border-radius: 0px; + transition: box-shadow 0.2s; + -webkit-transition: box-shadow 0.2s; + outline: none; +} +.dropdown-input .btn:hover, +.dropdown-input .btn:focus { + background: rgba(119,34,17,0.8); + box-shadow: 0 0 3px 0px white; + color: rgba(119,34,17,0.8); +} +.dropdown-input i { + font-size: 30px; + color: white; +} +.dropdown-input select { + width: 100%; + height: 50px; + background: rgba(0,0,0,0.1); + padding: 0; + border: solid #ffffff 1px; + border-radius: 0px; + transition: box-shadow 0.2s; + -webkit-transition: box-shadow 0.2s; + outline: none; + font-size: 18px; + font-family: 'Lato-Regular'; + color: rgba(0,0,0,0); +} +.dropdown-input select:hover, +.dropdown-input select:focus { + background: rgba(119,34,17,0.3); + box-shadow: 0 0 3px 0px white; +} +.dropdown-input .company-options { + background: rgba(0,0,0,0.1); + color: rgba(119,34,17,1); +} +.dropdown-input .company-options:hover, +.dropdown-input .company-options:focus { + background: white; +} +@media(max-width:768px) { + .step-box .dropdown-input select { + width: 100%; + } +} +/*style for "instructions" on the right of step 5*/ +.dropdown-menu span:hover { + background-color: rgba(119,34,17,0.3); +} +/*end of custom styles for steps*/ +/*custom styles for account view///////////////////////////////////////////////////*/ +.table-imported { + padding-top: 10%; + padding-bottom: 10%; +} + +/** page structure **/ +#wrapper { + display: block; + width: 100%; + background: #fff; + margin: 0 auto; + padding: 0 0 0 0; + -webkit-box-shadow: 2px 2px 3px -1px rgba(0,0,0,0.35); +} + +#keywords { + margin: 0 auto; + font-size: 1.2em; + margin-bottom: 15px; +} + + +#keywords thead { + cursor: pointer; + background: rgba(119,34,17,0.3); +} +#keywords thead tr th { + font-weight: bold; + padding: 12px 30px; + padding-left: 42px; +} +#keywords thead tr th span { + padding-right: 20px; + background-repeat: no-repeat; + background-position: 100% 100%; +} + +#keywords thead tr th.headerSortUp, #keywords thead tr th.headerSortDown { + background: #acc8dd; +} + +#keywords thead tr th.headerSortUp span { + +} +#keywords thead tr th.headerSortDown span { + +} + + +#keywords tbody tr { + color: #555; +} +#keywords tbody tr td { + text-align: center; + padding: 15px 10px; +} +#keywords tbody tr td.lalign { + text-align: left; +} + +.projectList-title { + padding-top: 5px; + padding-bottom: 5px; +} +@media(max-width:750px) { + + +} +/*end of custom styles for account view*/ \ No newline at end of file diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html index 7eaf853..6d3b52c 100755 --- a/src/main/webapp/index.html +++ b/src/main/webapp/index.html @@ -13,18 +13,18 @@ - + - + - + - + @@ -40,19 +40,19 @@