frikiminutos 2016 (enero{abril), serie b · cracking the coding interview: 150 programming...

100
Frikiminutos 2016 (enero–abril), serie B ETSIT – URJC Jes´ us M. Gonz´ alez Barahona, Gregorio Robles Mart´ ınez http://gsyc.es/ ~ jgb http://gsyc.es/ ~ grex/ GSyC, Universidad Rey Juan Carlos 17 de abril de 2016 Jes´ us M. Gonz´ alez Barahona, Gregorio Robles Mart´ http://gsyc.es/ Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 1 / 100

Upload: others

Post on 11-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Frikiminutos 2016 (enero–abril), serie BETSIT – URJC

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez

http://gsyc.es/~jgb http://gsyc.es/~grex/

GSyC, Universidad Rey Juan Carlos

17 de abril de 2016

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 1 / 100

Page 2: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

c©2015-2016 Gregorio Robles, Jesus M. Gonzalez Barahona.Algunos derechos reservados. Este artıculo se distribuye bajo la licencia

“Reconocimiento-CompartirIgual 3.0 Espana” de Creative Commons, disponible enhttp://creativecommons.org/licenses/by-sa/3.0/es/deed.es

Este documento (o uno muy similar) esta disponible enhttp://cursosweb.github.io

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 2 / 100

Page 3: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

1 ¿Te esta traicionando tunavegador?

2 Trabajo top3 Viendose con gente...4 Servidor web en Produccion5 Contenedores por todas partes6 Virtualizando, que es gerundio7 Atom8 Coffeescript9 Navegar en tres dimensiones

10 Unified Modeling Language

11 El fin del tiempo12 Disena tus cosas13 Scalable Vector Graphics14 Texto para todos los gustos15 JSLint16 Test-driven Development17 ¿Me la han jugado?18 XSS: Cross-site scripting19 Datos grandes en tu pequeno

ordenador20 El alfabeto de la elite21 Puestos a instalar... instala

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 3 / 100

Page 4: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

¿Te esta traicionando tu navegador?

¿Te esta traicionando tunavegador?

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 4 / 100

Page 5: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

¿Te esta traicionando tu navegador?

Panopticlick

https://panopticlick.eff.org/

Comprobacion detecnicas de tracking

Basta con cargar el sitiocon tu navegador

Analisis de variastecnicas de tracking

Especialmenteinteresante:fingerprinting

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 5 / 100

Page 6: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

¿Te esta traicionando tu navegador?

Resultado del analisis

[Prueba con y sin la navegacion privada de tu navegador]Metodologıa: https://panopticlick.eff.org/about

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 6 / 100

Page 7: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

¿Te esta traicionando tu navegador?

Fingerprinting

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 7 / 100

Page 8: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Trabajo top

Trabajo top

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 8 / 100

Page 9: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Trabajo top

¿Que es un trabajo bueno?

Un trabajo que te permita ser creativo

Un trabajo donde trabajes con ultimas tecnologıas

Un trabajo donde puedas ascender sin dejar de ser ingeniero

Un trabajo donde te paguen bien (y otros beneficios)

Hay muchas empresas donde buscan este tipo de perfil: Google, Apple,Facebook, Microsoft, Yahoo!, Amazon...

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 9 / 100

Page 10: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Trabajo top

Salarios en las companıas top

http://img59.imageshack.us/img59/802/toppaytech.png

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 10 / 100

Page 11: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Trabajo top

¿Que te piden en estos trabajos?

Estructuras de datos

Algoritmia

Experiencia en programacion

Redes de ordenadores

Sistemas operativos

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 11 / 100

Page 12: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Trabajo top

Mas lecturas

Hay varios libros sobre este tema, algunos en la biblioteca:

Cracking the coding interview: 150 programming interview questionsand solutionsThe Google InterviewElements of Programming Interviews: The Insiders’ GuideTop 10 coding interview problems asked in Google with solutions:Algorithmic ApproachAre You Smart Enough to Work at Google?: Fiendish Puzzles AndImpossible Interview Questions From The World’s Top CompaniesGet a Job WITHOUT an Interview - Google & Beyond!: “We don’tmind to lose a good applicant, but definitely not hire a bad applicant.”The Google Resume: How to Prepare for a Career and Land a Job atApple, Microsoft, Google, or any Top Tech Company

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 12 / 100

Page 13: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Viendose con gente...

Viendose con gente...

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 13 / 100

Page 14: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Viendose con gente...

Meetup

http://meetup.com

Informacion sobrereuniones cercanas

Mucho contenido tenico

Y mucho que noJesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 14 / 100

Page 15: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Viendose con gente...

Grupos

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 15 / 100

Page 16: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Viendose con gente...

Reuniones

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 16 / 100

Page 17: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Servidor web en Produccion

Servidor web en Produccion

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 17 / 100

Page 18: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Servidor web en Produccion

Lo que ensenamos en clase

http://django-project.com

Mono-hilo

Mono-tarea

Cache basico

Base de datos limitada(sqlite)

Pensado para paginasdinamicas

Sin planificacion

No tiempo real

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 18 / 100

Page 19: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Servidor web en Produccion

Un servidor web en produccion

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 19 / 100

Page 20: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Servidor web en Produccion

Tecnologıas

Django: Framework web

Nginx: Servidor web con balanceo de carga (http://nginx.org/)

Memcached: Cache (http://memcached.org/)

gunicorn: Servidor HTTP (http://gunicorn.org/)

Celery: Tiempo real y planificacion de tareas(http://www.celeryproject.org/)

RabbitMQ: Mensajerıa (https://www.rabbitmq.com/)

PostgreSQL: Base de datos (http://www.postgresql.org/)

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 20 / 100

Page 21: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Contenedores por todas partes

Contenedores por todaspartes

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 21 / 100

Page 22: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Servidor web en Produccion

Contenedores software

Virtualizacion sobresistema operativo

Evolucion de la idea dechroot

Aislamiento(disco, memoria)

Gestion de recursos

Mas ligero quemaquinas virtualescompletas

Mismo kernelque host

Docker, LXC, LXD,FreeBSD Jail...

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 22 / 100

Page 23: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Servidor web en Produccion

Docker (search trend)

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 23 / 100

Page 24: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Servidor web en Produccion

Docker

http://docker.com

http://hub.docker.com/

Automatizacion del desplieguede aplicaciones encontenedores software

Montado sobre cgroups(gestion de recursos),namespaces(separacion de recursos),sistema de ficheros con union

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 24 / 100

Page 25: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Servidor web en Produccion

Referencias y enlaces

Luke Price, “Containers, Port of Rotterdam”, CC-by 2.0https://www.flickr.com/photos/lukeprice88/9703431992

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 25 / 100

Page 26: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Virtualizando, que es gerundio

Virtualizando, que es gerundio

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 26 / 100

Page 27: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Virtualizando, que es gerundio

Maquina virtual

Maquina virtual:“Entorno de sistema operativoo aplicacionque se instala sobre softwareque imita un hardware dedicado.

Hipervisor:comparte y gestiona el hardwareaisla cada entorno

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 27 / 100

Page 28: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Virtualizando, que es gerundio

Algunos sistemas usados en virtualizacion

QEMU: maquina virtual, emula varias arquitecturashardware

Xen: hipervisor con arquitectura microkernel

KVM: extiende Linux con funciones de hipervisor

VirtualBox: hipervisor para x86

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 28 / 100

Page 29: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Virtualizando, que es gerundio

Una oferta cualquiera...

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 29 / 100

Page 30: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Atom

Atom

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 30 / 100

Page 31: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Atom

Introduciendo Atom

http://atom.io (Hay paquete Debian)

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 31 / 100

Page 32: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Atom

Caracterısticas

Basado HTML, JavaScript, CSS, and Node.js

Programado en CoffeeScript (compilado a JavaScript)

Autocompletado

Paquetes adicionales

Muchos temas

Configurable

Multiplataforma

... y es software libre

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 32 / 100

Page 33: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Coffeescript

Coffeescript

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 33 / 100

Page 34: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Coffeescript

The basics

coffeescript.org

Sintaxis mas sencilla

Orientado a ser legible

Breve

Indentacion

No hay parentesis

En 2012 fue el 11o

lenguage mas popular enGitHub

Se puede probar en lınea

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 34 / 100

Page 35: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Coffeescript

¿Como funciona?

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 35 / 100

Page 36: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Coffeescript

Ejemplos

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 36 / 100

Page 37: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Navegar en tres dimensiones

Navegar en tres dimensiones

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 37 / 100

Page 38: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Coffeescript

WebGL

Mantenido por elKhronos Group

API JavaScript para graficosinteractivos en 3D

Primeros desarrollos porMozilla

Proporcionada por losprincipales navegadores

Puede mezclarse con HTML

Basado en OpenGL

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 38 / 100

Page 39: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Coffeescript

Bibliotecas y utilidades

API alto nivel: three.js, babylon.js

Motores de juegos: Unreal 4, Unity 5

Creacion de escenas: Blender con Blend4Web, Clara.io

http://threejs.org/

http://babylonjs.com/

https://blend4web.com/

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 39 / 100

Page 40: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Coffeescript

Algunos ejemplos

Cubehttp://www.playmapscube.com/

Experience Curiosity (Blend4Web)http://eyes.nasa.gov/curiosity/

Sponza demo (babylon.js)http://www.babylonjs.com/Demos/Sponza/

Above the clouds (three.js)http://earth.plus360degrees.com/

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 40 / 100

Page 41: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Coffeescript

Referencias y enlaces

WebGL en Wikipediahttps://en.wikipedia.org/wiki/WebGL

WebGL en Mozilla Developer Networkhttps://developer.mozilla.org/en-US/docs/Web/API/WebGL_API

“3D image of Cornell Box scene made with WebGL”,from StormEngineC 3D Library, GFDL 1.2

https://commons.wikimedia.org/wiki/File:

WebGL_Cornell_Box.png

“WebGL tutorial”, by Mozillahttps://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/

Tutorial

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 41 / 100

Page 42: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Unified Modeling Language

Unified Modeling Language

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 42 / 100

Page 43: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Unified Modeling Language

Caracterısticas

Lenguaje de modelado de sistemas software

Respaldado por el OMG (Object Management Group)

Grafico

Sirve para visualizar, especificar, construir y documentar

Pretender ser el “plano” que tienen los arquitectos

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 43 / 100

Page 44: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Unified Modeling Language

Diagrama de Clases

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 44 / 100

Page 45: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Unified Modeling Language

Diagrama de Paquetes

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 45 / 100

Page 46: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Unified Modeling Language

Diagrama de Casos de Uso

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 46 / 100

Page 47: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Unified Modeling Language

Diagrama de Secuencia

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 47 / 100

Page 48: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Unified Modeling Language

Software para UML

Libre

ArgoUMLDiaUML Designer...

Privativo

Rational RoseMS Visio...

On-line (privativos)

createlyGliffy...

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 48 / 100

Page 49: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

El fin del tiempo

El fin del tiempo

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 49 / 100

Page 50: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

El fin del tiempo

El problema del ano 2038

En Unix,el tiempo se medıa

con un enterode 32 bits con signo.

Numero de segundosa partir de “the epoch”

The epoch (tiempo 0):00:00:00 UTC,1 enero 1970

Tiempo mas avanzadoposible:03:14:07 UTC,19 enero 2038

Un segundo mas:20:45:52 UTC,13 diciembre 1901

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 50 / 100

Page 51: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

El fin del tiempo

32 bits en accion

https://en.wikipedia.org/wiki/Year_2038_problem#/media/

File:Year_2038_problem.gif

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 51 / 100

Page 52: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

El fin del tiempo

32 bits en accion (sobrepasados)

Sobrepasamiento de entero

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 52 / 100

Page 53: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

El fin del tiempo

Mas informacion

Unix time en tiempo realhttp://www.coolepochcountdown.com/

Celebrando el 1234567890:https://youtu.be/z7Fl7qCO4Zo

Numberphile: End of Time (Unix)https://youtu.be/QJQ691PTKsA

Wikipedia: el problema del 2038https://en.wikipedia.org/wiki/Year_2038_problem

¿No recuerdas el complemento a uno?https://en.wikipedia.org/wiki/Signed_number_

representations

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 53 / 100

Page 54: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Disena tus cosas

Disena tus cosas

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 54 / 100

Page 55: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Disena tus cosas

Blender

Editor grafico 3D

Software libre

http://blender.org

Usado para:

pelıculas animadas

efectos visuales

impresion 3D

aplicaciones 3D

juegos

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 55 / 100

Page 56: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Disena tus cosas

Interfaz de usuario

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 56 / 100

Page 57: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Disena tus cosas

Curiosidades y caracterısticas

Liberacion (2002):100.000 euros(crowdfunded)

Plataformas:Linux, Windows,MacOS

Incluye editor de video,motor de juegos,exportador a WebGL

Pelıculas “demo”:Elephants Dream,Big Buck Bunnie,Sintel, Tears of Steel

https://www.blender.org/

features/projects/

Caracterısticas:

https:

//www.blender.org/features/

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 57 / 100

Page 58: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Scalable Vector Graphics

Scalable Vector Graphics

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 58 / 100

Page 59: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Scalable Vector Graphics

¿Que es SVG?

SVG es vectorial

Apto para iconos e imagenes de alta calidad

Puede ampliarse o reducirse sin perder calidad (esencial para laresponsive web)

Permite optimizacion gracias a la cache de recursos graficos

Los navegadores modernos ofrecen soporte SVG nativo

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 59 / 100

Page 60: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Scalable Vector Graphics

El porque de SVG visualmente

Source: https://commons.wikimedia.org/wiki/File:Bitmap VS SVG.svg

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 60 / 100

Page 61: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Scalable Vector Graphics

SVG

SVG es un estandar basado en XML del W3C

Permite tres tipos de objetos graficos:

Elementos geometricos vectoriales (p.e. caminos consistentes en rectasy curvas, y areas limitadas por ellos)Imagenes de mapa de bits /digitalesTexto

Existe un validador del W3C

Hay multiples herramientas para manipular SVGs: Inkscape, AdobeIllustrator, ...

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 61 / 100

Page 62: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Scalable Vector Graphics

Ejemplo de SVG

Un ejemplo con SVG:

<svg xmlns="http://www.w3.org/2000/svg" version="1.1">

<rect x="25" y="25" width="200" height="200" fill="lime"

stroke-width="4" stroke="pink" />

<circle cx="125" cy="125" r="75" fill="orange" />

<polyline points="50,150 50,200 200,200 200,100" stroke="red"

stroke-width="4" fill="none" />

<line x1="50" y1="50" x2="200" y2="200" stroke="blue"

stroke-width="4" />

</svg>

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 62 / 100

Page 63: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Scalable Vector Graphics

Resultado visual

Source: https://commons.wikimedia.org/wiki/File:SVG example markup grid.svg

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 63 / 100

Page 64: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Texto para todos los gustos

Texto para todos los gustos

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 64 / 100

Page 65: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Texto para todos los gustos

Unicode

http://unicode.org/

Meta: texto en cualquier sistemade escritura

codificacion

representacion

129 sistemas de escritura

conjuntos de otros sımbolos

mas de 120.000 caracteres

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 65 / 100

Page 66: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Texto para todos los gustos

Principios

Se codifican los grafemas (definicion abstracta)

No trata sobre la representacion

Cada grafema, un numero (31 bits)Ejemplo: U+00F1 (n)

U+0000 – U+00FF: Latin-1

Codificaciones:

UTF-8: anchura variable, compatible con ASCII

UTF-16: anchura variable, mejor para ideogramas

UTF-32: anchura fija

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 66 / 100

Page 67: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Texto para todos los gustos

Primeros caracteres

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 67 / 100

Page 68: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Texto para todos los gustos

Caracteres arabicos

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 68 / 100

Page 69: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Texto para todos los gustos

Emojis

http://unicode-table.com

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 69 / 100

Page 70: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

JSLint

JSLint

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 70 / 100

Page 71: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

JSLint

¿Que es JSLint?

lint es una herramienta de ayuda al programador

lint se utiliza para detectar codigo sospechoso, confuso oincompatible entre distintas arquitecturas en programas escritos en C(no detectado por el compilador)

Se basa en analisis estatico de codigo fuente

JSLint permite analizar codigo JavaScript (y estructuras JSON)

Es una herramienta on-line (aunque se puede descargar y ejecutar enlocal)

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 71 / 100

Page 72: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

JSLint

JSLint

Source: http://jslint.com/

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 72 / 100

Page 73: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Test-driven Development

Test-driven Development

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 73 / 100

Page 74: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Test-driven Development

Source: http://inside.runroom.com/wp-content/uploads/2015/04/validacion-contrasenas-TDD.png

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 74 / 100

Page 75: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Test-driven Development

El cırculo del TDD

Source: https://leantesting-wp.s3.amazonaws.com/resources/wp-content/uploads/2015/02/tdd-circle-of-life.png

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 75 / 100

Page 76: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Test-driven Development

Ejemplo de un test

newTest("Test the adding of two numbers").Execute = function () {

var calc = {};

calc.add = function () {

}

this.AreEqual(2, calc.add(1,1), "One plus one should equal two");

}

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 76 / 100

Page 77: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Test-driven Development

Utilizando un framework

Source: http://ariya.ofilabs.com/wp-content/uploads/2014/04/venusjs.png

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 77 / 100

Page 78: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Test-driven Development

Frameworks para TDD en JavaScript

QUnit

Jasmine

Sinon

TestSwarm

Karma y Protactor

... y muchas mas

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 78 / 100

Page 79: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

¿Me la han jugado?

¿Me la han jugado?

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 79 / 100

Page 80: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

¿Me la han jugado?

Have I been pwned?

http://haveibeenpwned.com/

¿Te han comprometidoalguna cuenta?

Coleccion de info sobresitios comprometidos

300 millones de cuentascomprometidas(marzo 2016)

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 80 / 100

Page 81: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

¿Me la han jugado?

Grupos

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 81 / 100

Page 82: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

¿Me la han jugado?

Grupos

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 82 / 100

Page 83: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

XSS: Cross-site scripting

XSS: Cross-site scripting

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 83 / 100

Page 84: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

XSS: Cross-site scripting

¿Que es XSS?

Tipo de vulnerabilidad en aplicaciones web

Es la mas comun segun algunos estudios (hasta el 80 % de losataques son XSS)

Se inyecta codigo en paginas web

Se utiliza para saltarse limitaciones de control de acceso (como sameorigin)

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 84 / 100

Page 85: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

XSS: Cross-site scripting

Tipos de ataques XSS

No persistentes (en la peticion HTTP o en el formulario enviado porel cliente)

Persistentes (cuando el codigo proviene del servidor servidor)

DOM-based XSS (no interviene el servidor)

Para evitarlos:

Validar cualquier tipo de datos enviados por los usuarios (i.e.,sanitizing -limpiar- la peticion)

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 85 / 100

Page 86: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

XSS: Cross-site scripting

Ejemplo de ataque XSS: No persistente

Source: http://excess-xss.com/reflected-xss.png

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 86 / 100

Page 87: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

XSS: Cross-site scripting

Ejemplo de ataque XSS: Persistente

Source: http://www.acunetix.com/wp-content/uploads/2013/08/Diagram-Describing-Blind-XSS-Attack.gif

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 87 / 100

Page 88: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

XSS: Cross-site scripting

Ejemplo de ataque XSS: DOM-based

Source: http://excess-xss.com/dom-based-xss.png

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 88 / 100

Page 89: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Datos grandes en tu pequeno ordenador

Datos grandes en tu pequenoordenador

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 89 / 100

Page 90: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Datos grandes en tu pequeno ordenador

La pila ELK

http://elastic.co

ElasticSearch: base dedatos

Logstash: recogida dedatos

Kibana: visualizacion dedatos

Todo puede instalarsefacilmente en tu ordenador(solo necesitas una maquinade Java).

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 90 / 100

Page 91: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Datos grandes en tu pequeno ordenador

ElasticSearch / Logstash

Base de datos no relacional

Unidad de informacion: documentos JSON

Muy escalable

Eficiente en muchos tipos de busquedas

Interfaz Java y REST

Bibliotecas para muchos lenguajes

Logstash: recogida de datos para muchas fuentes dedatos

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 91 / 100

Page 92: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Datos grandes en tu pequeno ordenador

Kibana

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 92 / 100

Page 93: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

El alfabeto de la elite

El alfabeto de la elite

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 93 / 100

Page 94: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

El alfabeto de la elite

Leetspeak

¿s4b35 h4bl4rc0m0 l05 fr1k15d3 v3rd4d?

https:

//en.wikipedia.org/wiki/Leet

Leet (“1337”) es unalfabeto alternativo

Origen: BBSs de los anos1980

“El habla de la elite”(admin de las BBS)

Muchas variantes

Incluye vocabuliario,gramatica...

Ejemplo: “31337 h4x0r”

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 94 / 100

Page 95: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

El alfabeto de la elite

Hay conversores...

http://www.robertecker.com/hp/research/leet-converter.php

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 95 / 100

Page 96: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

El alfabeto de la elite

Geek code

-----BEGIN GEEK CODE BLOCK-----

GED/J d-- s:++>: a--

C++(++++) ULU++ P+ L++

E---- W+(-) N+++ o+ K+++ w--- O-

M+ V--

PS++>$ PE++>$

Y++ PGP++ t-

5+++ X++ R+++>$

TV+ b+ DI+++ D+++ G+++++ e++ h r--

y++**

------END GEEK CODE BLOCK------

https://en.wikipedia.org/wiki/Geek_CodeJesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 96 / 100

Page 97: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Puestos a instalar... instala

Puestos a instalar... instala

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 97 / 100

Page 98: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Puestos a instalar... instala

Bower

Gestion de paquetes paraaplicaciones web

JavaScript

Proporciona enganchespara otras herramientas

Mas de 50.000 paquetes(abril 2016)

http://bower.io/

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 98 / 100

Page 99: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Puestos a instalar... instala

Instalacion

$ npm install bower

[Instalacion en node_modules]

$ node_modules/bower/bin/bower install jquery

[Instalacion en bower_components/jquery]

$ ls bower_components/jquery

bower.json dist LICENSE.txt README.md src

$ ls bower_components/jquery/dist/

jquery.js jquery.min.js jquery.min.map

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 99 / 100

Page 100: Frikiminutos 2016 (enero{abril), serie B · Cracking the coding interview: 150 programming interview questions and solutions The Google Interview Elements of Programming Interviews:

Puestos a instalar... instala

Otras opciones

$ bower install

[Installs depedencies in bower.json]

$ bower init

[Creates a bower.json]

$ bower update jquery

[Updates jquery to newest version]

$ bower list

[List local packages and possible updates]

Search packages: http://bower.io/search/Mas opciones: http://bower.io/docs/api/

Jesus M. Gonzalez Barahona, Gregorio Robles Martınez (http://gsyc.es/~jgb http://gsyc.es/~grex/ GSyC, Universidad Rey Juan Carlos)Frikiminutos 2016 (enero–abril), serie B 17 de abril de 2016 100 / 100