Skip to content

Instantly share code, notes, and snippets.

View juananpe's full-sized avatar
🎯
Focusing

Juanan Pereira juananpe

🎯
Focusing
View GitHub Profile
@juananpe
juananpe / Lag.java
Created November 30, 2017 12:24
Lag klasea
package hasiera;
import java.awt.Image;
import java.net.URL;
import java.util.Vector;
import javax.swing.ImageIcon;
public class Lag {
String izena;
@juananpe
juananpe / intro.R
Last active December 18, 2017 21:15
intro.R
?cars
str(cars)
summary(cars)
gg <- ggplot(cars, aes(x=speed, y=dist)) +
geom_point()
plot(gg)
gg <- ggplot(cars, aes(x=speed, y=dist)) +
@juananpe
juananpe / linearReg.R
Created December 18, 2017 21:16
linearReg.R
library(ggplot2)
# Price, Age, KM(kilometers driven), Fuel Type,
# HP(horsepower), Automatic or Manual, Number of Doors,
# and Weight in pounds are the data collected in this file for
# Toyota Corollas.
toyota <- read.csv("https://raw.githubusercontent.com/datailluminations/PredictingToyotaPricesBlog/master/ToyotaCorolla.csv")
g <- ggplot(toyota, aes(Price))
@juananpe
juananpe / films.R
Created December 18, 2017 21:16
films.R
library('rvest')
url <- 'http://www.imdb.com/search/title?count=100&release_date=2018,2016&title_type=feature'
webpage <- read_html(url)
#Using CSS selectors to scrap the rankings section
rank_data_html <- html_nodes(webpage,'.text-primary')
#Converting the ranking data to text
rank_data <- html_text(rank_data_html)
#Data-Preprocessing: Converting rankings to numerical
@juananpe
juananpe / ejercicio.html
Created February 13, 2018 21:39
Código HTML para el ejercicio de introducción a CSS
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="estiloa.css">
</head>
<body>
<div id="menu">
<ul>
<li><a href="index.html"> ERREZETAK</a></li>
<li><a href="formularioa.html">BIDALI ZURE ERREZETA </a></li>
@juananpe
juananpe / debugger.html
Last active February 13, 2018 21:42
HTML para ejercicio con debugger
<!doctype html>
<html>
<head>
<script src="debugger.js"></script>
</head>
<body>
</body>
@juananpe
juananpe / debugger.js
Created February 13, 2018 21:43
Código JS para el ejercicio con debugger
class Ejercicio {
constructor(){
this.w = this.width = 194, this.height= 122;
this.g = Array(this.width*(this.height+2)).fill(0);
for(let i=0; i< this.width; i++){
for(let j=0; j< this.height; j++){
if (j <= 2 || j >= this.height - 2 )
@juananpe
juananpe / qunit-assert-canvas.js
Created February 18, 2018 12:36
qunit-assert-canvas.js
QUnit.extend(QUnit.assert, {
pixelEqual: function(canvas, x, y, r, g, b, a, message) {
var actual = Array.prototype.slice.apply(canvas.getContext("2d").getImageData(x, y, 1, 1).data),
expected = [r, g, b, a];
QUnit.push(QUnit.equiv(actual, expected), actual, expected, message);
},
pixelNotEqual: function(canvas, x, y, r, g, b, a, message) {
var actual = Array.prototype.slice.apply(canvas.getContext("2d").getImageData(x, y, 1, 1).data),
expected = [r, g, b, a];
message = message || "should not be " + expected;
@juananpe
juananpe / fifa.R
Created March 25, 2019 11:02 — forked from yrochat/fifa.R
The code for article #20 on my blog (about FIFA)
rm(list=ls())
library(readr) # importation
library(RTextTools) # classification de textes
library(textreuse) # plagiat
library(tm) # text mining
library(ggplot2) # visualisations
library(lsa) # latent semantic analysis
library(stringr) # manipulation de chaines de caractères
@juananpe
juananpe / fifa.csv
Created March 25, 2019 11:03 — forked from yrochat/fifa.csv
We can make this file beautiful and searchable if this error is corrected: Any value after quoted field isn't allowed in line 1.
"journal";"note";"auteur";"url";"annee";"texte"
"gamekult";"70";"puyo";"http://www.gamekult.com/jeux/test-fifa-17-SU3050706473t.html#ps4";"2017";"Si vous avez un tant soit peu suivi l'actualité de FIFA 17 depuis son annonce, vous savez déjà qu'il ne s'agit pas d'un FIFA +1 comme il en paraît chaque année. Pour ce millésime 2016, la simu d'EA Sports fait peau neuve en se dotant d'un nouveau moteur, le Frostbite cher à Battlefield, histoire de se mettre à niveau tout en bénéficiant des améliorations régulières apportées par les ingénieurs maison. Forcément, qui dit nouveau moteur sous-entend une liste considérable de changements et de petits ajustements, pour ne pas dire de concessions ; Konami avait d'ailleurs essuyé les plâtres il y a quelques années en osant le pari du Fox Engine, qui a longtemps tâtonné avant de parvenir à un compromis satisfaisant en 2016. FIFA 17 saura-t-il trouver la bonne formule dès le coup d'envoi ? \n Si l'on se place du point de vue dév, FIFA 17 tient du petit exploit. Même si le pr