Skip to content

Instantly share code, notes, and snippets.

@pdrjmg
pdrjmg / Dashboard.java
Created February 11, 2018 12:24
Product Management System (Web Application with Glassfish)
package productManagement.user;
import com.vaadin.cdi.CDIViewProvider;
import com.vaadin.navigator.Navigator;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Component;
import com.vaadin.ui.CssLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
@pdrjmg
pdrjmg / Exercise 4.R
Created January 4, 2018 15:42
Rank Function in R
#Pedro Jaime González
#Matrikelnummer 81726
#Modern E-Shops
#Implementieren Sie in R eine Methode rank(products, method, var), die ein Dataframe von
#Produkten übergeben bekommt und diese mit einer bestimmten Methode (method) sortiert. Als
#Methoden sollen möglich sein:
#*ascending: Die Produkte werden aufsteigend nach ihrer Ausprägung des Attributes var sortiert und zurückgegeben
#*descending: Die Produkte werden absteigend nach ihrer Ausprägung des Attributes var sortiert und zurückgegeben
@pdrjmg
pdrjmg / Exercise 3.R
Created January 4, 2018 15:40
Euclidean distance, Pearson correlation and Collaborative filtering in R
#Pedro Jaime González
#Matrikelnummer 81726
#Modern E-Shops
#a) Function to calculate the Euclidean distance
#b) Function to calculate the Pearson correlation
#c) Function that uses "Collaborative Filtering" to determine new rating
example = matrix(c(
5, 25, 18, 20, 5, 80,
@pdrjmg
pdrjmg / index.html
Last active January 11, 2018 08:38
John Mayer tribute page
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet">
<!-- here starts the page -->
<!-- Title -->
<body>
<div class = "container-fluid">
<div class = "jumbotron">
<h1 id="title" class="gray-text text-center">John C. Mayer</h1>
<div class="row">
<div class="col-lg-12 col-md-12 col-xs-12">
@pdrjmg
pdrjmg / IncorrectNumberOfColumnsException.java
Created November 26, 2017 15:54
Online analytical processing in Java
/**
* Class created for the custom IncorrectNumberOfColumnsException exception
* @author Pedro Jaime González
*/
public class IncorrectNumberOfColumnsException extends Exception {
private static final long serialVersionUID = 1;
String message;
/**
@pdrjmg
pdrjmg / Hangman.java
Created November 26, 2017 15:51
Hangman in Java
import java.util.Scanner;
/**
* <h1>Hangman</h1>
* <p>
* The Hangman program implements an application that lets you play the classic hangman game.
* The user types a word at the beginning of the program and then must try to guess either
* letters of said word or the complete word itself. Every time the user guesses a correct letter,
* the letter inside the word is printed.