├── js ├── web │ ├── template │ │ ├── style.css │ │ ├── code.js │ │ └── index.html │ ├── shuffle_words │ │ ├── style.css │ │ ├── index.html │ │ ├── code.js │ │ ├── chaffle.min.js │ │ └── chaffle.original.min.js │ ├── star_wars │ │ ├── bg.jpg │ │ ├── index.html │ │ ├── code.js │ │ ├── wars.svg │ │ ├── star.svg │ │ └── style.css │ ├── footer_waves │ │ ├── wave-bot.png │ │ ├── wave-mid.png │ │ ├── wave-top.png │ │ ├── index.html │ │ └── style.css │ ├── borderless_youtube │ │ ├── style.css │ │ └── index.html │ ├── infinite_photo_grid │ │ ├── photo-grid.jpg │ │ ├── index.html │ │ └── style.css │ ├── html_include │ │ ├── html_base.html │ │ └── html_template.html │ ├── glowing_ball │ │ ├── index.html │ │ └── style.css │ ├── popup_blurred_background │ │ ├── code.js │ │ └── index.html │ ├── sine_waves │ │ ├── index.html │ │ └── style.css │ ├── coffee │ │ └── code.js │ ├── move_around │ │ ├── index.html │ │ ├── code.js │ │ └── style.css │ ├── popup_after_delay_sendy │ │ ├── code.js │ │ ├── style.css │ │ └── fancy.css │ ├── star_background │ │ ├── index.html │ │ ├── style.css │ │ └── code.js │ ├── rotating_text │ │ ├── index.html │ │ ├── style.css │ │ └── code.js │ ├── paper_plane_button │ │ └── index.html │ ├── popup_close_button_css │ │ ├── index.html │ │ └── style.css │ ├── form_fancy_border │ │ ├── index.html │ │ └── style.css │ ├── popup_after_delay_cookies │ │ ├── style.css │ │ ├── code.js │ │ └── index.html │ ├── toggle_hidding_showing.html │ ├── floating_balls │ │ ├── index.html │ │ ├── style.css │ │ └── code.js │ ├── exit_popup_cookies │ │ └── index.html │ ├── accordion │ │ └── style.css │ └── shooting_stars │ │ ├── style.scss │ │ └── index.html ├── io_base │ ├── test │ │ └── test.js │ └── fs_io.js ├── system │ └── system_info.js ├── copyright_autodate.html ├── log_base │ └── timer.js ├── data_manipulation │ ├── base64.js │ ├── string_manipulation.js │ └── array_manipulation.js └── xml_http_request │ ├── server.py │ └── templates │ └── index.html ├── php ├── system │ ├── phpinfo.php │ └── file_size.php ├── io_base │ ├── write_txt.php │ └── read_txt.php ├── email_base │ ├── email_with_headers.php │ ├── simple_email.php │ ├── email_with_html_content.php │ ├── email_form.html │ └── email_form.php └── README.md ├── command_line ├── windows │ ├── reduce_pdf_size.txt │ ├── nvidia-smi.txt │ ├── network.txt │ ├── system.txt │ ├── resources_management.txt │ └── WSL.md ├── linux │ ├── edit_media.sh │ ├── web.sh │ ├── pdf_merge_multiple.sh │ ├── url.sh │ ├── time.sh │ ├── string_manipulation.sh │ ├── format_conversion.sh │ ├── conda_exists.sh │ ├── clean.sh │ ├── resources_management.sh │ ├── system.sh │ ├── pdf_reduce_size.sh │ ├── paths.sh │ └── compress.sh ├── conda_info.txt ├── docker │ ├── tensorflow │ │ └── dockerfile │ ├── mxnet │ │ └── dockerfile │ ├── caffe2 │ │ └── dockerfile │ ├── cntk │ │ └── dockerfile │ ├── base │ │ └── dockerfile │ ├── mxnet_distributed │ │ └── dockerfile │ ├── chainer │ │ └── dockerfile │ ├── pytorch │ │ ├── Dockerfile │ │ └── README.md │ ├── keras │ │ └── dockerfile │ └── README.md └── pip_info.txt ├── .github ├── PULL_REQUEST_TEMPLATE.md └── CODEOWNERS ├── latex ├── iros │ ├── root.tex │ └── IEEEbcpat.bib ├── icra │ └── sample_new.tex └── thesis │ ├── Capitulo7 │ └── ch_conclusions.tex │ ├── Capitulo2 │ └── ch_basics.tex │ ├── Capitulo5 │ └── ch_fraccional.tex │ ├── Capitulo1 │ └── ch_intro.tex │ ├── Capitulo6 │ └── ch_postural_control.tex │ ├── Capitulo4 │ └── ch_multiple_behaviors.tex │ ├── additional │ ├── chapter_abstract.tex │ ├── chapter_resumen.tex │ ├── prefacio.tex │ └── chapter_acknowledgements.tex │ └── Capitulo3 │ └── ch_imitation.tex ├── .gitattributes ├── sql ├── sqlite │ ├── manage_database.txt │ ├── count.sql │ ├── select_values.sql │ ├── insert_values.sql │ └── manage_table.sql ├── sql_server │ ├── kill_process.sql │ ├── stored_procedure_execute.sql │ ├── odbcinst.ini │ ├── insert_values.sql │ ├── count.sql │ ├── operations.sql │ ├── enable_external_scripts.sql │ ├── change_auth.sql │ ├── stored_procedure_create.sql │ ├── manage_table.sql │ ├── set_database_file_location.sql │ ├── select_values.sql │ └── joins.sql └── mysql │ ├── manage_database.sql │ ├── count.sql │ ├── create_user.sql │ ├── insert_values.sql │ ├── manage_table.sql │ └── README.md ├── .gitmodules ├── matlab ├── log_base │ └── timer_base.m ├── numeric │ ├── iterpolate_spline5.m │ ├── interpolate_spline3.m │ ├── desired_orientations.m │ ├── determine_matrixes_rotation.m │ └── derivate_data.m ├── data_manipulation │ ├── trajectoriesToRows.m │ └── trajectoriesToColumns.m ├── machine_learning │ └── k_nearest_neighbor.m ├── image_base │ └── gistdescriptor │ │ ├── imresizecrop.m │ │ ├── demoGist.m │ │ └── showGist.m └── plot_base │ └── show_q.m ├── cpp ├── playground.cpp ├── io │ ├── read_file.hpp │ └── read_file.cpp ├── log │ └── timer.hpp ├── numeric │ └── math_utils.hpp └── CMakeLists.txt ├── minsc ├── Rename_branch.md ├── Firefox.md ├── VSCode.md ├── Preferences.sublime-settings └── vscode_settings.json ├── README.md ├── LICENSE ├── .gitignore └── gs └── RutinaMacros.gs /js/web/template/style.css: -------------------------------------------------------------------------------- 1 | /* Attribution: */ -------------------------------------------------------------------------------- /php/system/phpinfo.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /js/web/shuffle_words/style.css: -------------------------------------------------------------------------------- 1 | /* Attribution: */ -------------------------------------------------------------------------------- /js/web/template/code.js: -------------------------------------------------------------------------------- 1 | // Attribution: 2 | -------------------------------------------------------------------------------- /js/io_base/test/test.js: -------------------------------------------------------------------------------- 1 | require("../fs_io"); 2 | 3 | -------------------------------------------------------------------------------- /command_line/windows/reduce_pdf_size.txt: -------------------------------------------------------------------------------- 1 | https://smallpdf.com/compress-pdf 2 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thanks for contributing to this codebase! 2 | 3 | -------------------------------------------------------------------------------- /command_line/windows/nvidia-smi.txt: -------------------------------------------------------------------------------- 1 | # Refresh nvidia-smi every 1s 2 | nvidia-smi -l 1 3 | -------------------------------------------------------------------------------- /latex/iros/root.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miguelgfierro/codebase/HEAD/latex/iros/root.tex -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # To detect sql files on Github statistics 2 | *.sql linguist-detectable=true 3 | 4 | -------------------------------------------------------------------------------- /js/web/star_wars/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miguelgfierro/codebase/HEAD/js/web/star_wars/bg.jpg -------------------------------------------------------------------------------- /latex/icra/sample_new.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miguelgfierro/codebase/HEAD/latex/icra/sample_new.tex -------------------------------------------------------------------------------- /sql/sqlite/manage_database.txt: -------------------------------------------------------------------------------- 1 | # To create a sqlite database, type in a terminal: 2 | sqlite3 db.sqlite3 3 | 4 | 5 | -------------------------------------------------------------------------------- /js/web/footer_waves/wave-bot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miguelgfierro/codebase/HEAD/js/web/footer_waves/wave-bot.png -------------------------------------------------------------------------------- /js/web/footer_waves/wave-mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miguelgfierro/codebase/HEAD/js/web/footer_waves/wave-mid.png -------------------------------------------------------------------------------- /js/web/footer_waves/wave-top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miguelgfierro/codebase/HEAD/js/web/footer_waves/wave-top.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "pybase"] 2 | path = pybase 3 | url = https://github.com/miguelgfierro/pybase 4 | branch = main 5 | -------------------------------------------------------------------------------- /command_line/linux/edit_media.sh: -------------------------------------------------------------------------------- 1 | # Cut audio 2 | ffmpeg -i input.mp3 -vn -acodec copy -ss 00:00:10 -to 00:00:30 output.mp3 3 | -------------------------------------------------------------------------------- /command_line/windows/network.txt: -------------------------------------------------------------------------------- 1 | # Get WIFI password once you are connected to a network 2 | netsh wlan show profile WIFI_NAME key=clear 3 | -------------------------------------------------------------------------------- /js/web/borderless_youtube/style.css: -------------------------------------------------------------------------------- 1 | .center{ 2 | display: block; 3 | margin-left: auto; 4 | margin-right: auto; 5 | width: 50%; 6 | } -------------------------------------------------------------------------------- /js/web/infinite_photo_grid/photo-grid.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miguelgfierro/codebase/HEAD/js/web/infinite_photo_grid/photo-grid.jpg -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/about-codeowners/ 2 | # for more info about CODEOWNERS file 3 | 4 | * @miguelgfierro 5 | -------------------------------------------------------------------------------- /php/system/file_size.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /command_line/linux/web.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Find DNS of a web 4 | dig NS +short miguelgfierro.com 5 | 6 | # Find IP of a web 7 | dig A +short miguelgfierro.com 8 | 9 | -------------------------------------------------------------------------------- /matlab/log_base/timer_base.m: -------------------------------------------------------------------------------- 1 | % Set timer with tic and stop timer with toc 2 | tic 3 | A = rand(12000, 4400); 4 | B = rand(12000, 4400); 5 | toc 6 | C = A'.*B'; 7 | t = toc; 8 | t 9 | -------------------------------------------------------------------------------- /sql/sql_server/kill_process.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- See all processes in SQL Server and kill one 3 | -- 4 | 5 | -- See all processes 6 | EXEC sp_who2 7 | 8 | -- Kill process 56 9 | kill 56 -------------------------------------------------------------------------------- /command_line/linux/pdf_merge_multiple.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Reduce pdf size 4 | # Installation in Linux: 5 | # $ sudo apt install ghostscript 6 | 7 | gs -sDEVICE=pdfwrite -o output.pdf input1.pdf input2.pdf 8 | 9 | -------------------------------------------------------------------------------- /matlab/numeric/iterpolate_spline5.m: -------------------------------------------------------------------------------- 1 | function x = interpolation (T, t, x0, x1, v0, v1) 2 | a = x0; 3 | b = v0; 4 | c = (3*(x1-x0) - T*(2*v0+v1))/T^2; 5 | d = (2*(x0-x1) + T*(v0+v1))/T^3; 6 | x = a + b*t + c*t.^2 + d*t.^3; -------------------------------------------------------------------------------- /matlab/numeric/interpolate_spline3.m: -------------------------------------------------------------------------------- 1 | % 3 degree spline 2 | function q = interpolate_spline3 (Ts, T, q0, q1) 3 | time = 0 : Ts : T-Ts; 4 | a = -2*(q1-q0)/T^3; 5 | b = 3*(q1-q0)/T^2; 6 | q = a * time.^3 + b * time.^2 + q0*ones(1,T/Ts); -------------------------------------------------------------------------------- /command_line/linux/url.sh: -------------------------------------------------------------------------------- 1 | # Download a file in a folder 2 | wget https:/...csv -P foldername 3 | 4 | # Download a file, resume partially downloaded file (-c), do not download if no change in server (-N) 5 | wget -c -N https:/...csv 6 | -------------------------------------------------------------------------------- /js/system/system_info.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Check whether or not the client is a phone 3 | */ 4 | function isMobile() { 5 | return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); 6 | } 7 | -------------------------------------------------------------------------------- /matlab/numeric/desired_orientations.m: -------------------------------------------------------------------------------- 1 | function [Rd, wd] = desired_orientations (T, Ts, Rd0) 2 | iterations = T/Ts; 3 | Rd = zeros(3,3, iterations); 4 | for ii=1:iterations 5 | Rd(:,:,ii) = Rd0; 6 | end 7 | wd = zeros(3,iterations); -------------------------------------------------------------------------------- /command_line/linux/time.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Time now 4 | now=$(date +"%T") 5 | echo "Current time: $now" # 17:19:32 6 | 7 | # Date and time now 8 | now=$(date +"%d/%m/%Y-%H:%M:%S") 9 | echo "Current time: $now" # 11/04/2022-17:19:32 10 | -------------------------------------------------------------------------------- /command_line/linux/string_manipulation.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Find a substring in a string 4 | string='My string'; 5 | if [[ $string =~ "My" ]]; then 6 | echo "It's there!" 7 | fi 8 | if [[ $string == *"My"* ]]; then 9 | echo "String found!" 10 | fi 11 | -------------------------------------------------------------------------------- /sql/mysql/manage_database.sql: -------------------------------------------------------------------------------- 1 | -- Create new database 2 | CREATE DATABASE my_database; 3 | 4 | -- Show available databases 5 | SHOW DATABASES; 6 | 7 | -- Select database 8 | USE my_database; 9 | 10 | -- Remove database 11 | DROP DATABASE my_database; 12 | 13 | -------------------------------------------------------------------------------- /sql/sql_server/stored_procedure_execute.sql: -------------------------------------------------------------------------------- 1 | --- 2 | --- Execute the stored procedure created in file stored_procedure_create.sql 3 | --- 4 | 5 | DECLARE @VariableOutputSP FLOAT; 6 | EXECUTE dbo.StoredProcedureName @VariableInput = 0, @VariableOutput = @VariableOutputSP; 7 | -------------------------------------------------------------------------------- /sql/sql_server/odbcinst.ini: -------------------------------------------------------------------------------- 1 | [FreeTDS] 2 | Description = TDS Driver for MSSQL in Linux. First you need to install sudo apt-get install tdsodbc. You need to copy this file to /etc/odbcinst.ini 3 | driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so 4 | setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so 5 | -------------------------------------------------------------------------------- /cpp/playground.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "io/read_file.hpp" 3 | #include "log/timer.hpp" 4 | #include "numeric/math_constants.hpp" 5 | #include "numeric/math_utils.hpp" 6 | 7 | int main(int argc, char *argv[]) { 8 | std::cout << "Playground" << std::endl; 9 | 10 | 11 | return 0; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /js/web/html_include/html_base.html: -------------------------------------------------------------------------------- 1 |

Hakuna Matata!

2 |

What a wonderful phrase

3 |

Hakuna Matata!

4 |

Ain't no passing craze

5 |

6 | It means no worries
7 | For the rest of your days
8 | It's our problem-free philosophy
9 | Hakuna Matata! 10 |

-------------------------------------------------------------------------------- /command_line/linux/format_conversion.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Convert from SVG to PDF 4 | inkscape --without-gui --file=foo.svg --export-pdf=foo.pdf 5 | 6 | # Convert from PDF to SVG 7 | inkscape --without-gui --file=foo.pdf --export-plain-svg=foo.svg 8 | 9 | # Convert from mp4 to mp3 10 | ffmpeg -i 01.mp4 01.mp3 11 | -------------------------------------------------------------------------------- /minsc/Rename_branch.md: -------------------------------------------------------------------------------- 1 | # Renaming a GitHub branch from master to main 2 | 3 | After renaming the branch on GitHub (from master to main), in your local repo, you can do: 4 | 5 | ```bash 6 | git branch -m master main 7 | git fetch origin 8 | git branch -u origin/main main 9 | git remote set-head origin -a 10 | ``` 11 | -------------------------------------------------------------------------------- /sql/sql_server/insert_values.sql: -------------------------------------------------------------------------------- 1 | -- Cheatsheet: https://github.com/FavioVazquez/ds-cheatsheets/blob/master/SQL/SQL-cheat-sheet.pdf 2 | 3 | -- Example of values insertion in a table 4 | INSERT INTO table_name 5 | ( 6 | patient_id, 7 | size_row, 8 | size_col, 9 | array 10 | ) 11 | VALUES (?,?,?,?) 12 | 13 | -------------------------------------------------------------------------------- /js/web/glowing_ball/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /command_line/conda_info.txt: -------------------------------------------------------------------------------- 1 | # Execute a python file on a conda environment 2 | conda run -n env_name my_python_file.py 3 | 4 | # Search a package 5 | conda search -f cudatoolkit 6 | conda search -f cudatoolkit -c conda-forge 7 | conda search -f cudatoolkit -c numba 8 | 9 | # Remove unused and cached packages 10 | conda clean --all 11 | -------------------------------------------------------------------------------- /matlab/data_manipulation/trajectoriesToRows.m: -------------------------------------------------------------------------------- 1 | % This function put a set of several trajectories in rows 2 | % WARNING: It takes the longer dimension as the time dimension 3 | function [traj_new columns rows] = trajectoriesToRows(traj) 4 | 5 | [traj_c cs rs] = trajectoriesToColumns(traj); 6 | traj_new = traj_c'; 7 | columns = rs; 8 | rows = cs; -------------------------------------------------------------------------------- /sql/sqlite/count.sql: -------------------------------------------------------------------------------- 1 | -- Count total number of rows in a table 2 | SELECT COUNT(*) FROM table_name; 3 | 4 | -- Count the number of non null records in a column 5 | SELECT COUNT(column_name) FROM table_name; 6 | 7 | -- Count the number of distinct records in a column 8 | SELECT COUNT(DISTINCT column_name) FROM table_name; 9 | 10 | 11 | -------------------------------------------------------------------------------- /command_line/linux/conda_exists.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Check if a conda environment exists 4 | TARGET_ENV="py36" 5 | ENVS=$(conda env list | awk '{print $1}' ) 6 | if [[ $ENVS = *"$TARGET_ENV"* ]]; then 7 | echo "Environment exists" 8 | else 9 | echo "Error: The environment provided doesn't exist." 10 | exit 11 | fi; 12 | 13 | -------------------------------------------------------------------------------- /sql/mysql/count.sql: -------------------------------------------------------------------------------- 1 | -- Count total number of rows in a table 2 | SELECT COUNT(*) FROM my_database.table_name; 3 | 4 | -- Count the number of non null records in a column 5 | SELECT COUNT(column_name) FROM my_database.table_name; 6 | 7 | -- Count the number of distinct records in a column 8 | SELECT COUNT(DISTINCT column_name) FROM my_database.table_name; 9 | -------------------------------------------------------------------------------- /js/web/infinite_photo_grid/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /js/copyright_autodate.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |

Copyright © 12 | Company Name - All rights reserved

13 | 14 | 15 | -------------------------------------------------------------------------------- /sql/sql_server/count.sql: -------------------------------------------------------------------------------- 1 | -- Count total number of rows in a table 2 | SELECT COUNT(*) FROM database_name.table_name; 3 | 4 | -- Count the number of non null records in a column 5 | SELECT COUNT(column_name) FROM database_name.table_name; 6 | 7 | -- Count the number of distinct records in a column 8 | SELECT COUNT(DISTINCT column_name) FROM database_name.table_name; 9 | 10 | 11 | -------------------------------------------------------------------------------- /sql/sql_server/operations.sql: -------------------------------------------------------------------------------- 1 | -- Combine rows from two queries 2 | SELECT c1, c2 FROM t1 3 | UNION [ALL] 4 | SELECT c1, c2 FROM t2; 5 | 6 | -- Return the intersection of two queries 7 | SELECT c1, c2 FROM t1 8 | INTERSECT 9 | SELECT c1, c2 FROM t2; 10 | 11 | -- Subtract a result set from another result set 12 | SELECT c1, c2 FROM t1 13 | MINUS 14 | SELECT c1, c2 FROM t2; 15 | 16 | -------------------------------------------------------------------------------- /command_line/windows/system.txt: -------------------------------------------------------------------------------- 1 | # Memory details (in bytes) 2 | wmic MEMORYCHIP get BankLabel, DeviceLocator, Capacity, Speed 3 | 4 | # Memory (in Mb) 5 | systeminfo | findstr /C:”Total Physical Memory” 6 | 7 | # For Total Physical Memory (in bytes) 8 | wmic ComputerSystem get TotalPhysicalMemory 9 | 10 | # For Available Physical Memory (in bytes) 11 | wmic OS get FreePhysicalMemory 12 | 13 | -------------------------------------------------------------------------------- /php/io_base/write_txt.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /js/web/popup_blurred_background/code.js: -------------------------------------------------------------------------------- 1 | // Attribution: https://codepen.io/jaeming/pen/XWyaMe 2 | $(function () { 3 | $('.pop-up').hide(); 4 | $('.pop-up').fadeIn(3000); 5 | 6 | $('.close-button').click(function (e) { 7 | 8 | $('.pop-up').fadeOut(700); 9 | $('#overlay').removeClass('blur-in'); 10 | $('#overlay').addClass('blur-out'); 11 | e.stopPropagation(); 12 | }); 13 | }); -------------------------------------------------------------------------------- /js/web/template/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /command_line/linux/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Check size 4 | df -h / 5 | du -sh /home 6 | du -sh / 7 | 8 | # Clean unused libraries in conda 9 | conda clean -a 10 | 11 | # Review conda environments 12 | conda env list 13 | conda env remove -n ENV_NAME 14 | 15 | # Clean tmp files 16 | rm -rf tmp/* 17 | 18 | # Clean unused Ubuntu files 19 | sudo apt-get clean 20 | sudo apt-get autoremove 21 | sudo apt-get autoclean 22 | 23 | -------------------------------------------------------------------------------- /js/log_base/timer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Get current date in the format yyyy-mm-dd HH:mm:ss 3 | * @return {String} - Date 4 | */ 5 | function getDateFromNow(){ 6 | var date = new Date(); 7 | return date.getFullYear()+'-'+(date.getMonth()<10?'0':'')+(date.getMonth()+1)+'-'+(date.getDate()<10?'0':'')+date.getDate()+' '+(date.getHours()<10?'0':'')+date.getHours()+':'+(date.getMinutes()<10?'0':'')+date.getMinutes()+':'+(date.getSeconds()<10?'0':'')+date.getSeconds(); 8 | } 9 | -------------------------------------------------------------------------------- /js/web/sine_waves/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /js/web/sine_waves/style.css: -------------------------------------------------------------------------------- 1 | /* Attribution: https://codepen.io/Cancepto/pen/OMQdJx */ 2 | 3 | body { 4 | background-color: #2F2F31; 5 | } 6 | 7 | ::-webkit-scrollbar { 8 | width: 8px; 9 | } 10 | 11 | ::-webkit-scrollbar-track { 12 | background: #2F2F31; 13 | } 14 | 15 | ::-webkit-scrollbar-thumb { 16 | background: #2F2F31; 17 | } 18 | 19 | ::-webkit-scrollbar-thumb:hover { 20 | background: #2F2F31; 21 | } 22 | -------------------------------------------------------------------------------- /js/data_manipulation/base64.js: -------------------------------------------------------------------------------- 1 | // Converts and image or video to base64 2 | 3 | // Package: https://www.npmjs.com/package/datauri 4 | // To install: $ npm install --save datauri 5 | // To run: node base64.js 6 | 7 | const datauri = require('datauri'); 8 | 9 | const file = 'path/to/image/i.png' 10 | //const file = 'path/to/video/v.mp4' 11 | 12 | datauri(file, (err, content, meta) => { 13 | if (err) { 14 | throw err; 15 | } 16 | console.log(content) 17 | }); 18 | -------------------------------------------------------------------------------- /js/web/coffee/code.js: -------------------------------------------------------------------------------- 1 | // Attribution: 2 | 3 | function resize() { 4 | if (window.innerWidth <= 800) { 5 | console.log('set to 4'); 6 | document.getElementById('blurFilter').setAttribute('stdDeviation', 4); 7 | } else { 8 | console.log('set to 10'); 9 | document.getElementById('blurFilter').setAttribute('stdDeviation', 8); 10 | } 11 | } 12 | 13 | window.addEventListener("resize", resize); 14 | document.addEventListener("DOMContentLoaded", resize); 15 | -------------------------------------------------------------------------------- /js/web/move_around/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 |

Take a look around

15 |
16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sql/sqlite/select_values.sql: -------------------------------------------------------------------------------- 1 | -- Select all entries equal to a value in a column 2 | SELECT * FROM table_name WHERE column_name = value 3 | 4 | 5 | -- Select top N values of specific column names 6 | SELECT column_name1, column_name2 FROM table_name ASC LIMIT 5; 7 | 8 | 9 | -- Select top N rows ordered by a column 10 | SELECT * FROM table_name ORDER BY column_name ASC LIMIT 5; 11 | 12 | 13 | -- Select a random row 14 | SELECT * FROM table_name LIMIT 1 15 | OFFSET ABS(RANDOM()) % MAX((SELECT COUNT(*) FROM table_name), 1) 16 | -------------------------------------------------------------------------------- /command_line/windows/resources_management.txt: -------------------------------------------------------------------------------- 1 | #list processes 2 | C:\> tasklist 3 | Image Name PID Session Name Mem Usage 4 | ========================= ======== ================ ============ 5 | firefox.exe 26356 Console 139,352 K 6 | regedit.exe 24244 Console 9,768 K 7 | cmd.exe 18664 Console 2,380 K 8 | 9 | #Kill a process 10 | C:\>Taskkill /IM firefox.exe /F 11 | #or 12 | C:\>Taskkill /PID 26356 /F 13 | 14 | -------------------------------------------------------------------------------- /php/io_base/read_txt.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /matlab/machine_learning/k_nearest_neighbor.m: -------------------------------------------------------------------------------- 1 | % K nearest neighbor 2 | % 3 | % knnsearch finds the K nearest neighbor in X for each point in Y. 4 | % IDX is the index of the K nearest neighbors in X. 5 | % D is the distance of the K nearest neighbor in X to Y. 6 | % IDX, D and Y have the same number of rows. 7 | % source: https://es.mathworks.com/help/stats/knnsearch.html 8 | 9 | rng('default') % for reproducibility 10 | X = randn(100000,512); 11 | Y = randn(2,512); 12 | tic 13 | [IDX,D] = knnsearch(X,Y,'K',5,'Distance','euclidean') 14 | toc 15 | -------------------------------------------------------------------------------- /js/web/popup_after_delay_sendy/code.js: -------------------------------------------------------------------------------- 1 | 2 | function onPopupOpen() { 3 | $("#modal-content").css("display", "flex"); 4 | $("#FirstName").focus(); 5 | } 6 | 7 | function onPopupClose() { 8 | $("#modal-content").hide(); //equivalent to CSS display:none 9 | lastFocus.focus(); 10 | } 11 | 12 | var lastFocus; 13 | var delay = 3000; 14 | 15 | setTimeout(function () { 16 | lastFocus = document.activeElement; 17 | onPopupOpen(); 18 | }, delay); 19 | 20 | $(".close-button").on("click", function () { 21 | onPopupClose(); 22 | }); -------------------------------------------------------------------------------- /command_line/linux/resources_management.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #list processes 4 | $ ps -ef | grep 'python myscript.py' 5 | hoaphum+ 62074 1 0 11:37 pts/0 00:00:00 grep python myscript.py 6 | hoaphum+ 62075 1 0 11:38 pts/0 00:00:00 grep python myscript.py 7 | 8 | #list processes IDs 9 | $ ps -ef | grep 'python myscript.py' | awk '{print $2}' 10 | 62074 11 | 62075 12 | 13 | #kill a process 14 | $ kill -9 62074 15 | 16 | #kill all processes containing a specific name 17 | kill -9 `ps -ef | grep 'python myscript.py' | awk '{print $2}'` 18 | 19 | 20 | -------------------------------------------------------------------------------- /php/email_base/email_with_headers.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /php/email_base/simple_email.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /js/web/shuffle_words/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

Hello world

13 | 14 |

This is shuffling

15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /js/web/shuffle_words/code.js: -------------------------------------------------------------------------------- 1 | var elements = document.querySelectorAll('[data-chaffle]'); 2 | var elm = document.querySelectorAll('[data-chaffle-onLoad]'); 3 | 4 | Array.prototype.forEach.call(elements, function (el) { 5 | var chaffle = new Chaffle(el) 6 | el.addEventListener('mouseover', function () { 7 | chaffle.init(); 8 | }); 9 | }); 10 | 11 | Array.prototype.forEach.call(elm, function (el) { 12 | var chaffle = new Chaffle(el, { 13 | delay: 200 14 | }) 15 | setInterval(function () { 16 | chaffle.init(); 17 | }, 8000) 18 | }); 19 | -------------------------------------------------------------------------------- /js/xml_http_request/server.py: -------------------------------------------------------------------------------- 1 | # Attribution: https://gist.github.com/KentaYamada/2eed4af1f6b2adac5cc7c9063acf8720 2 | 3 | from flask import Flask, request, render_template 4 | 5 | app = Flask(__name__) 6 | app.debug = True 7 | 8 | 9 | @app.route("/", methods=["GET", "POST"]) 10 | def index(): 11 | if request.method == "POST": 12 | name = request.form["name"] 13 | return "Hello " + name 14 | # NOTE: index.html needs to be in a folder called templates 15 | return render_template("index.html") 16 | 17 | 18 | if __name__ == "__main__": 19 | app.run() 20 | -------------------------------------------------------------------------------- /matlab/numeric/determine_matrixes_rotation.m: -------------------------------------------------------------------------------- 1 | function [R_right, R_left] = determine_matrixes_rotation (alfa) 2 | % matrix rotation in axis z of angle alfa1 3 | R = [cos(alfa/2), -sin(alfa/2), 0; 4 | sin(alfa/2), cos(alfa/2), 0; 5 | 0, 0, 1]; 6 | 7 | %rotation from reference to matrix rotation R 8 | rot = [0, -1, 0; 9 | 1, 0, 0; 10 | 0, 0, 1]; 11 | 12 | %rotation matrix for right leg (from origin to end-point) 13 | rot_right = [1, 0, 0; 14 | 0, 0, 1; 15 | 0, -1, 0]; 16 | 17 | R_left = rot*R*rot'; 18 | R_right = rot_right*R_left; -------------------------------------------------------------------------------- /js/data_manipulation/string_manipulation.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Replace a string pattern with another 3 | * @param {String} data - The string to be cleaned 4 | * @param {String} string_to_clean - Character or group of characters to clean 5 | * @param {String} string_to_replace - Character or group of characters replacing the string_to_clean 6 | * @return {String} - The string cleaned 7 | */ 8 | function cleanString(data, string_to_clean, string_to_replace){ 9 | var regex = new RegExp(string_to_clean, "g"); 10 | data = data.trim(); 11 | data = data.replace(regex, string_to_replace); 12 | return data; 13 | } 14 | -------------------------------------------------------------------------------- /sql/sql_server/enable_external_scripts.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Enable external scripts like R or python. 3 | -- More info: 4 | -- https://docs.microsoft.com/en-us/sql/advanced-analytics/r-services/set-up-sql-server-r-services-in-database 5 | -- 6 | -- NOTE: After executing the script you have to restart the server (MSSQLSERVER Launchpad in services) 7 | -- for this to work. To ensure that the service is activated run_value has to be set to 1. 8 | -- 9 | 10 | -- See SQL Server configuration 11 | sp_configure 12 | 13 | -- Enable external scripts 14 | Exec sp_configure 'external scripts enabled', 1 15 | Reconfigure with override 16 | 17 | -------------------------------------------------------------------------------- /js/data_manipulation/array_manipulation.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Remove repeated values in an array 3 | * @param {Array} a - An array 4 | * @return {Array} - An array with unique values 5 | */ 6 | function getUniqueArray(a) { 7 | var prims = {"boolean":{}, "number":{}, "string":{}}, objs = []; 8 | return a.filter(function(item) { 9 | var type = typeof item; 10 | if(type in prims){ 11 | return prims[type].hasOwnProperty(item) ? false : (prims[type][item] = true); 12 | } 13 | else { 14 | return objs.indexOf(item) >= 0 ? false : objs.push(item); 15 | } 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /command_line/linux/system.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # System release (LSB=Linux Standard Base) 4 | lsb_release -a 5 | 6 | # Machine name, kernel name, version 7 | uname -a 8 | 9 | # Lists all PCI buses and devices connected to them 10 | lspci 11 | 12 | # Lists all USB buses and any connected USB devices 13 | lsusb 14 | 15 | # Lists detailed information of the hardware, like motherboard, 16 | # CPU, BIOS, memory, buses and network 17 | lshw 18 | 19 | # Returns the current public IP 20 | curl ifconfig.me 21 | 22 | # Print all environment variables 23 | printenv 24 | 25 | # Check whether I'm using bash, sh or other 26 | echo $SHELL 27 | -------------------------------------------------------------------------------- /js/web/star_background/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /js/web/star_wars/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | Star 14 | Wars 15 |

The Force Awakens

16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /sql/mysql/create_user.sql: -------------------------------------------------------------------------------- 1 | -- Create a new SQL login user 2 | -- Replace login name 'miguel' and password with your choice of user name/password 3 | -- In version 8, the default authentification method is caching sha2 4 | -- https://dev.mysql.com/doc/refman/8.0/en/caching-sha2-pluggable-authentication.html 5 | CREATE USER IF NOT EXISTS 'miguel'@'localhost' IDENTIFIED BY 'password'; 6 | 7 | -- To create a new user with the legacy password method: 8 | CREATE USER 'nativeuser'@'localhost' 9 | IDENTIFIED WITH mysql_native_password BY 'password'; 10 | 11 | -- To grant root priviledges 12 | GRANT ALL PRIVILEGES ON *.* TO 'nativeuser'@'localhost'; 13 | 14 | -------------------------------------------------------------------------------- /sql/mysql/insert_values.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Example of values insertion in a table 3 | -- 4 | USE my_database; 5 | 6 | -- The primary key is an auto-increment value, there is no need to insert it 7 | INSERT INTO table_name 8 | ( 9 | recid, 10 | filename, 11 | float_num, 12 | letter, 13 | input_date 14 | ) 15 | VALUES 16 | ( 17 | 77, 18 | 'miguel.csv', 19 | 3.14159, 20 | 'A', 21 | '2017-04-12' 22 | ); 23 | 24 | SELECT * FROM table_name; 25 | 26 | -- Load a csv file 27 | LOAD DATA LOCAL INFILE '/Users/miguel/run3x/codebase/share/traj.csv' 28 | INTO TABLE table_csv 29 | FIELDS TERMINATED BY ',' 30 | LINES TERMINATED BY '\n' 31 | (t, q0 , q1); 32 | 33 | 34 | SELECT * FROM table_csv; 35 | -------------------------------------------------------------------------------- /matlab/image_base/gistdescriptor/imresizecrop.m: -------------------------------------------------------------------------------- 1 | function img = imresizecrop(img, M, METHOD) 2 | % 3 | % img = imresizecrop(img, M, METHOD); 4 | % 5 | % Output an image of size M(1) x M(2). 6 | 7 | if nargin < 3 8 | METHOD = 'bilinear'; 9 | end 10 | 11 | if length(M) == 1 12 | M = [M(1) M(1)]; 13 | end 14 | 15 | scaling = max([M(1)/size(img,1) M(2)/size(img,2)]); 16 | 17 | %scaling = M/min([size(img,1) size(img,2)]); 18 | 19 | newsize = round([size(img,1) size(img,2)]*scaling); 20 | img = imresize(img, newsize, METHOD); 21 | 22 | [nr nc cc] = size(img); 23 | 24 | sr = floor((nr-M(1))/2); 25 | sc = floor((nc-M(2))/2); 26 | 27 | img = img(sr+1:sr+M(1), sc+1:sc+M(2),:); 28 | 29 | -------------------------------------------------------------------------------- /sql/sqlite/insert_values.sql: -------------------------------------------------------------------------------- 1 | -- Insert values in a table 2 | INSERT INTO table_name 3 | ( 4 | id, 5 | recid, 6 | filename, 7 | float_num, 8 | letter, 9 | input_date 10 | ) 11 | VALUES 12 | ( 13 | 0, 14 | 77, 15 | 'miguel.csv', 16 | 3.14159, 17 | 'A', 18 | '2017-04-12' 19 | ); 20 | 21 | SELECT * FROM table_name; 22 | 23 | -- Load csv into table_csv 24 | .mode csv 25 | .import '/Users/miguel/run3x/codebase/share/traj.csv' table_csv 26 | SELECT * FROM table_csv; 27 | 28 | -- Load csv into table_csv ignoring the header 29 | --DROP TABLE IF EXISTS table_csv; 30 | .mode csv 31 | .import '|tail -n +2 /Users/miguel/run3x/codebase/share/traj_header.csv' table_csv 32 | SELECT * FROM table_csv; 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /matlab/data_manipulation/trajectoriesToColumns.m: -------------------------------------------------------------------------------- 1 | % This function put a set of several trajectories in columns 2 | % WARNING: It takes the longer dimension as the time dimension 3 | function [traj_new columns rows] = trajectoriesToColumns(traj) 4 | 5 | %if (isvector(traj)) 6 | % traj_new = traj'; 7 | % columns = 1; 8 | % rows = length(traj_new); 9 | %elseif (ismatrix(traj)) 10 | [dim1 dim2] = size(traj); 11 | if (dim1 > dim2) % Column trajectory 12 | rows = dim1; 13 | columns = dim2; 14 | traj_new = traj; 15 | else 16 | rows = dim2; 17 | columns = dim1; 18 | traj_new = traj'; 19 | end 20 | %else 21 | % traj_new = traj; 22 | % columns = 1; 23 | % rows = length(traj_new); 24 | %end -------------------------------------------------------------------------------- /cpp/io/read_file.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef READ_FILE_HPP 3 | #define READ_FILE_HPP 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | /** 11 | Example: 12 | std::string filename = "../../../share/traj.csv"; 13 | std::vector data; 14 | bool flag = readCSVFile(filename, data); 15 | if(!flag) std::cerr << "File not read correctly" << std::endl; 16 | for(size_t i = 0; i < data.size(); i++){ 17 | std::cout << data.at(i) << std::endl; 18 | } 19 | */ 20 | bool readFile(const std::string filename, std::vector& data, std::string sep_char=" "); 21 | bool readCSVFile(const std::string filename, std::vector& data); 22 | 23 | 24 | #endif //READ_FILE_HPP 25 | -------------------------------------------------------------------------------- /js/web/html_include/html_template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | HTML code 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /js/web/rotating_text/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |

Nachos are

14 |

15 | tasty. 16 | wonderful. 17 | fancy. 18 | beautiful. 19 | cheap. 20 |

21 |
22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /sql/sqlite/manage_table.sql: -------------------------------------------------------------------------------- 1 | -- Drop the table if it exists 2 | DROP TABLE IF EXISTS table_name; 3 | 4 | -- Create a table 5 | CREATE TABLE table_name 6 | ( 7 | id SMALLINT NOT NULL PRIMARY KEY, 8 | recid INT(11) NOT NULL DEFAULT '0', 9 | filename VARCHAR(250) NOT NULL DEFAULT '', 10 | num INT(11) NULL, 11 | float_num FLOAT(8,6) NOT NULL DEFAULT '0', 12 | letter CHAR(1), 13 | input_date DATE 14 | ); 15 | 16 | -- Show information about the table 17 | PRAGMA table_info([table_name]); 18 | 19 | -- Select all table 20 | SELECT * FROM table_name; 21 | 22 | 23 | -- Create a table to upload a csv 24 | CREATE TABLE table_csv 25 | ( 26 | t FLOAT(8,6) NOT NULL DEFAULT '0', 27 | q0 INT(5) NOT NULL DEFAULT '0', 28 | q1 INT(5) NOT NULL DEFAULT '0' 29 | ); 30 | -------------------------------------------------------------------------------- /js/web/paper_plane_button/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /js/web/popup_close_button_css/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | Let me Pop up 14 |
15 | 16 |
17 |
18 |

Here i am

19 | × 20 |
21 | Thank to pop me out of that button, but now i'm done so you can close this window. 22 |
23 |
24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /sql/sql_server/change_auth.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- This SQL script allows you to generate a new user and password in SQL Server 3 | -- 4 | 5 | USE master 6 | go 7 | 8 | -- Change authentication mode to mixed SQL and Windows authentication 9 | EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2 10 | go 11 | 12 | -- Create a new SQL login user 13 | -- Replace login name 'sqldba' and password with your choice of user name/password 14 | CREATE LOGIN sqldba 15 | WITH PASSWORD = N'new_password', 16 | CHECK_POLICY = OFF, 17 | CHECK_EXPIRATION = OFF; 18 | 19 | -- Change role of new user to sysadmin role 20 | -- Replace user name 'sqldba' with the one created above 21 | EXEC sp_addsrvrolemember 22 | @loginame = N'sqldba', 23 | @rolename = N'sysadmin'; -------------------------------------------------------------------------------- /js/web/footer_waves/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /sql/sql_server/stored_procedure_create.sql: -------------------------------------------------------------------------------- 1 | --- 2 | --- Create a stored procedure with input and output variables 3 | --- 4 | 5 | USE [database_name] 6 | GO 7 | SET ANSI_NULLS ON 8 | GO 9 | SET QUOTED_IDENTIFIER ON 10 | GO 11 | 12 | IF OBJECT_ID('[dbo].[StoredProcedureName]', 'P') IS NOT NULL 13 | DROP PROCEDURE [dbo].[StoredProcedureName]; 14 | GO 15 | 16 | CREATE PROCEDURE [dbo].[StoredProcedureName] 17 | @VariableInput INT, 18 | @VariableOutput FLOAT OUTPUT 19 | AS 20 | BEGIN 21 | -- SET NOCOUNT ON added to prevent extra result sets from 22 | -- interfering with SELECT statements. 23 | SET NOCOUNT ON; 24 | 25 | SELECT @VariableOutput = database_name 26 | FROM table_name 27 | WHERE column_name = @VariableInput 28 | 29 | PRINT 'Output:' 30 | PRINT @VariableOutput 31 | SELECT @VariableOutput 32 | END 33 | GO 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /command_line/linux/pdf_reduce_size.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Reduce pdf size 4 | # Installation in Linux: 5 | # $ sudo apt install ghostscript 6 | # 7 | # Installation in Mac: 8 | # brew install ghostscript 9 | # 10 | # Options: 11 | # -dPDFSETTINGS=/screen lower quality, smaller size. (72 dpi) 12 | # -dPDFSETTINGS=/ebook for better quality, but slightly larger pdfs. (150 dpi) 13 | # -dPDFSETTINGS=/prepress output similar to Acrobat Distiller "Prepress Optimized" setting (300 dpi) 14 | # -dPDFSETTINGS=/printer selects output similar to the Acrobat Distiller "Print Optimized" setting (300 dpi) 15 | # -dPDFSETTINGS=/default selects output intended to be useful across a wide variety of uses, possibly at the expense of a larger output file 16 | 17 | ps2pdf input.pdf output.pdf 18 | ps2pdf -dPDFSETTINGS=/ebook input.pdf output.pdf 19 | ps2pdf -dPDFSETTINGS=/printer input.pdf output.pdf 20 | -------------------------------------------------------------------------------- /cpp/log/timer.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef TIMER_HPP 3 | #define TIMER_HPP 4 | 5 | #include "time.h" 6 | 7 | class Timer 8 | { 9 | public: 10 | void startTimer() { m_start = clock();} 11 | void stopTimer() { m_end = clock();} 12 | double getTimeInSec(){ 13 | m_elapsed_time_sec = (double)(m_end-m_start)/CLOCKS_PER_SEC; 14 | std::cout << "Time required for execution: " << m_elapsed_time_sec << " seconds" << std::endl; 15 | return m_elapsed_time_sec; 16 | } 17 | double getTimeInMiliSec(){ 18 | m_elapsed_time_sec = (double)(m_end-m_start)/CLOCKS_PER_SEC; 19 | std::cout << "Time required for execution: " << m_elapsed_time_sec*1000 << " miliseconds" << std::endl; 20 | return m_elapsed_time_sec*1000; 21 | } 22 | 23 | private: 24 | clock_t m_start; 25 | clock_t m_end; 26 | double m_elapsed_time_sec; 27 | }; 28 | 29 | 30 | 31 | 32 | #endif //TIMER_HPP 33 | 34 | -------------------------------------------------------------------------------- /cpp/io/read_file.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "read_file.hpp" 3 | 4 | 5 | bool readFile(const std::string filename, std::vector& data, std::string sep_char){ 6 | std::ifstream file; 7 | std::string line; 8 | int npos, lpos; 9 | float d; 10 | file.open(filename.c_str(),std::ios::in); 11 | if(!file.is_open()) return false; 12 | while(getline(file,line)){ 13 | line += sep_char; 14 | npos=0; 15 | lpos=0; 16 | while ((npos = (int)line.find(sep_char,lpos)) != std::string::npos){ 17 | if (npos > lpos){ 18 | std::istringstream iss(line.substr(lpos, npos-lpos)); 19 | if (iss >> d){ 20 | data.push_back(d); 21 | } 22 | } 23 | lpos = npos + 1; 24 | } 25 | } 26 | 27 | return true; 28 | } 29 | 30 | bool readCSVFile(const std::string filename, std::vector& data){ 31 | return readFile(filename, data, ","); 32 | } 33 | -------------------------------------------------------------------------------- /sql/sql_server/manage_table.sql: -------------------------------------------------------------------------------- 1 | -- Cheatsheet: https://github.com/FavioVazquez/ds-cheatsheets/blob/master/SQL/SQL-cheat-sheet.pdf 2 | 3 | -- Drop the table if it exists 4 | IF OBJECT_ID('table_name') IS NOT NULL 5 | DROP TABLE table_name; 6 | 7 | -- Create a table with different variables. Not null variables must be always be filled, the rest 8 | -- may have null values 9 | CREATE TABLE table_name 10 | ( 11 | patient_id varchar(50) NOT NULL PRIMARY KEY, 12 | size_row INT NOT NULL, 13 | size_col INT DEFAULT 0, 14 | array varbinary(max) 15 | ); 16 | 17 | -- Add a new column to the table 18 | ALTER TABLE t ADD column; 19 | 20 | -- Drop column c from the table 21 | ALTER TABLE t DROP COLUMN c; 22 | 23 | -- Rename a table from t1 to t2 24 | ALTER TABLE t1 RENAME TO t2; 25 | 26 | -- Rename column c1 to c2 27 | ALTER TABLE t1 RENAME c1 TO c2; 28 | 29 | --Remove all data in a table 30 | TRUNCATE TABLE t; 31 | -------------------------------------------------------------------------------- /minsc/Firefox.md: -------------------------------------------------------------------------------- 1 | # Firefox 2 | 3 | ## Enable GPU 4 | 5 | Firefox doesn't use the GPU of your machine by default. 6 | 7 | To benefit from using the GPU of your computer when using Firefox, go to the browser and type `about:config` then set the following flags: 8 | 9 | ``` 10 | gfx.webrenderer.all true 11 | layers.acceleration.force-enabled true 12 | layers.omtp.enabled true 13 | layout.display-list.retain true 14 | ``` 15 | 16 | To check that Firefox is actually using the GPU, the first method is to check the GPU utilisation with methods like `nvidia-smi` or similar. Another way is to type in your browser `about:support`. In the section Graphics, you need to see: 17 | 18 | * GPU: Active Yes 19 | * HW_COMPOSITING: available by default, force_enabled by user:Force-enabled by pref 20 | * WEBRENDER: available by default, force_enabled by user:Force-enabled by pref, disabled by env: Not qualified 21 | -------------------------------------------------------------------------------- /sql/mysql/manage_table.sql: -------------------------------------------------------------------------------- 1 | --- 2 | --- Example of table creation 3 | --- 4 | 5 | USE my_database; 6 | 7 | -- Drop the table if it exists 8 | DROP TABLE IF EXISTS table_name; 9 | 10 | -- Create a table 11 | CREATE TABLE table_name 12 | ( 13 | id SMALLINT NOT NULL auto_increment, 14 | recid INT(11) NOT NULL DEFAULT '0', 15 | filename VARCHAR(250) NOT NULL DEFAULT '', 16 | num INT(11) NULL, 17 | float_num FLOAT(8,6) NOT NULL DEFAULT '0', 18 | letter CHAR(1), 19 | input_date DATE, 20 | PRIMARY KEY (id) 21 | ); 22 | 23 | -- Show information about the table 24 | DESCRIBE table_name; 25 | 26 | -- Select all table 27 | SELECT * FROM table_name; 28 | 29 | -- Create a table to upload a csv 30 | CREATE TABLE table_csv 31 | ( 32 | id SMALLINT NOT NULL auto_increment, 33 | t FLOAT(8,6) NOT NULL DEFAULT '0', 34 | q0 INT(5) NOT NULL DEFAULT '0', 35 | q1 INT(5) NOT NULL DEFAULT '0', 36 | PRIMARY KEY (id) 37 | ); 38 | 39 | -------------------------------------------------------------------------------- /sql/sql_server/set_database_file_location.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Script to change the default locations to save the database files 3 | -- 4 | 5 | USE [master] 6 | GO 7 |   8 | -- Change default location for data files 9 | EXEC   xp_instance_regwrite 10 |        N'HKEY_LOCAL_MACHINE', 11 |        N'Software\Microsoft\MSSQLServer\MSSQLServer', 12 |        N'DefaultData', 13 |        REG_SZ, 14 |        N'E:\mssql_databases' 15 | GO 16 |   17 | -- Change default location for log files 18 | EXEC   xp_instance_regwrite 19 |        N'HKEY_LOCAL_MACHINE', 20 |        N'Software\Microsoft\MSSQLServer\MSSQLServer', 21 |        N'DefaultLog', 22 |        REG_SZ, 23 |        N'E:\mssql_databases\logs' 24 | GO 25 |   26 | -- Change default location for backups 27 | EXEC   xp_instance_regwrite 28 |        N'HKEY_LOCAL_MACHINE', 29 |        N'Software\Microsoft\MSSQLServer\MSSQLServer', 30 |        N'BackupDirectory', 31 |        REG_SZ, 32 |        N'E:\mssql_databases\backup' 33 | GO -------------------------------------------------------------------------------- /command_line/docker/tensorflow/dockerfile: -------------------------------------------------------------------------------- 1 | FROM tensorflow/tensorflow:latest-gpu 2 | 3 | RUN pip install fire toolz 4 | 5 | COPY ssh_config /root/.ssh/config 6 | RUN apt-get update && apt-get install -y --no-install-recommends \ 7 | openssh-client \ 8 | openssh-server \ 9 | iproute2 \ 10 | && apt-get clean \ 11 | && rm -rf /var/lib/apt/lists/* \ 12 | # configure ssh server and keys 13 | && mkdir /var/run/sshd \ 14 | && ssh-keygen -A \ 15 | && sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config \ 16 | && sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd \ 17 | && ssh-keygen -f /root/.ssh/id_rsa -t rsa -N '' \ 18 | && chmod 600 /root/.ssh/config \ 19 | && chmod 700 /root/.ssh \ 20 | && cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys 21 | 22 | 23 | EXPOSE 23 24 | CMD ["/usr/sbin/sshd", "-D", "-p", "23"] 25 | 26 | -------------------------------------------------------------------------------- /command_line/docker/mxnet/dockerfile: -------------------------------------------------------------------------------- 1 | FROM mxnet/python:gpu 2 | 3 | RUN pip install fire toolz jupyter scipy scikit-learn 4 | 5 | COPY ssh_config /root/.ssh/config 6 | RUN apt-get update && apt-get install -y --no-install-recommends \ 7 | openssh-client \ 8 | openssh-server \ 9 | iproute2 \ 10 | && apt-get clean \ 11 | && rm -rf /var/lib/apt/lists/* \ 12 | # configure ssh server and keys 13 | && mkdir /var/run/sshd \ 14 | && ssh-keygen -A \ 15 | && sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config \ 16 | && sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd \ 17 | && ssh-keygen -f /root/.ssh/id_rsa -t rsa -N '' \ 18 | && chmod 600 /root/.ssh/config \ 19 | && chmod 700 /root/.ssh \ 20 | && cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys 21 | 22 | 23 | EXPOSE 23 24 | CMD ["/usr/sbin/sshd", "-D", "-p", "23"] 25 | 26 | -------------------------------------------------------------------------------- /js/web/move_around/code.js: -------------------------------------------------------------------------------- 1 | // Attribution: https://codepen.io/vajkri/pen/grgQmb 2 | 3 | var lFollowX = 0, 4 | lFollowY = 0, 5 | x = 0, 6 | y = 0, 7 | friction = 1 / 30; 8 | 9 | function moveBackground() { 10 | x += (lFollowX - x) * friction; 11 | y += (lFollowY - y) * friction; 12 | 13 | translate = 'translate(' + x + 'px, ' + y + 'px) scale(1.1)'; 14 | 15 | $('.bg').css({ 16 | '-webit-transform': translate, 17 | '-moz-transform': translate, 18 | 'transform': translate 19 | }); 20 | 21 | window.requestAnimationFrame(moveBackground); 22 | } 23 | 24 | $(window).on('mousemove click', function (e) { 25 | 26 | var lMouseX = Math.max(-100, Math.min(100, $(window).width() / 2 - e.clientX)); 27 | var lMouseY = Math.max(-100, Math.min(100, $(window).height() / 2 - e.clientY)); 28 | lFollowX = (20 * lMouseX) / 100; // 100 : 12 = lMouxeX : lFollow 29 | lFollowY = (10 * lMouseY) / 100; 30 | 31 | }); 32 | 33 | moveBackground(); -------------------------------------------------------------------------------- /command_line/docker/caffe2/dockerfile: -------------------------------------------------------------------------------- 1 | FROM caffe2ai/caffe2:c2v0.8.1.cuda8.cudnn7.ubuntu16.04 2 | 3 | RUN pip install fire toolz jupyter scipy scikit-learn 4 | 5 | COPY ssh_config /root/.ssh/config 6 | RUN apt-get update && apt-get install -y --no-install-recommends \ 7 | openssh-client \ 8 | openssh-server \ 9 | iproute2 \ 10 | && apt-get clean \ 11 | && rm -rf /var/lib/apt/lists/* \ 12 | # configure ssh server and keys 13 | && mkdir /var/run/sshd \ 14 | && ssh-keygen -A \ 15 | && sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config \ 16 | && sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd \ 17 | && ssh-keygen -f /root/.ssh/id_rsa -t rsa -N '' \ 18 | && chmod 600 /root/.ssh/config \ 19 | && chmod 700 /root/.ssh \ 20 | && cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys 21 | 22 | 23 | EXPOSE 23 24 | CMD ["/usr/sbin/sshd", "-D", "-p", "23"] 25 | 26 | -------------------------------------------------------------------------------- /command_line/docker/cntk/dockerfile: -------------------------------------------------------------------------------- 1 | FROM microsoft/cntk:2.1-gpu-python3.5-cuda8.0-cudnn6.0 2 | 3 | RUN ["/bin/bash", "-c", "source /cntk/activate-cntk && pip install fire toolz"] 4 | 5 | COPY ssh_config /root/.ssh/config 6 | RUN apt-get update && apt-get install -y --no-install-recommends \ 7 | openssh-client \ 8 | openssh-server \ 9 | iproute2 \ 10 | && apt-get clean \ 11 | && rm -rf /var/lib/apt/lists/* \ 12 | # configure ssh server and keys 13 | && mkdir /var/run/sshd \ 14 | && ssh-keygen -A \ 15 | && sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config \ 16 | && sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd \ 17 | && ssh-keygen -f /root/.ssh/id_rsa -t rsa -N '' \ 18 | && chmod 600 /root/.ssh/config \ 19 | && chmod 700 /root/.ssh \ 20 | && cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys 21 | 22 | 23 | EXPOSE 23 24 | CMD ["/usr/sbin/sshd", "-D", "-p", "23"] 25 | 26 | -------------------------------------------------------------------------------- /command_line/docker/base/dockerfile: -------------------------------------------------------------------------------- 1 | FROM nvidia/cuda:8.0-cudnn7-devel-ubuntu16.04 2 | 3 | RUN echo "deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list 4 | 5 | RUN apt-get update && apt-get install -y --no-install-recommends \ 6 | build-essential \ 7 | ca-certificates \ 8 | cmake \ 9 | wget \ 10 | curl \ 11 | git && \ 12 | rm -rf /var/lib/apt/lists/* 13 | 14 | ENV PYTHON_VERSION=3.6 15 | RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ 16 | chmod +x ~/miniconda.sh && \ 17 | ~/miniconda.sh -b -p /opt/conda && \ 18 | rm ~/miniconda.sh && \ 19 | /opt/conda/bin/conda create -y --name py$PYTHON_VERSION python=$PYTHON_VERSION numpy pyyaml scipy \ 20 | ipython mkl pandas jupyter ipykernel scikit-learn && \ 21 | /opt/conda/bin/conda clean -ya 22 | ENV PATH /opt/conda/envs/py$PYTHON_VERSION/bin:$PATH 23 | 24 | WORKDIR /workspace 25 | RUN chmod -R a+w /workspace 26 | 27 | -------------------------------------------------------------------------------- /js/web/popup_after_delay_sendy/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | /*Background simulating the sciblog page*/ 3 | background-color: #dcdbe0; 4 | background-image: url("https://raw.githubusercontent.com/miguelgfierro/sciblog/main/img/blog_view2.png"); 5 | background-size: 1200px; 6 | background-position: top; 7 | background-repeat: no-repeat; 8 | color: #100; 9 | } 10 | 11 | #modal-content { 12 | display: none; 13 | justify-content: center; 14 | align-items: center; 15 | height: 100vh; 16 | } 17 | 18 | .close-button { 19 | transition: all 0.5s ease; 20 | position: absolute; 21 | background-color: #e85f99; 22 | padding: 3px 3px; 23 | margin-left: -10px; 24 | margin-top: -9px; 25 | border: 2px solid #fff; 26 | color: white; 27 | -webkit-box-shadow: -4px -2px 6px 0px rgba(0, 0, 0, 0.1); 28 | -moz-box-shadow: -4px -2px 6px 0px rgba(0, 0, 0, 0.1); 29 | box-shadow: -3px 1px 6px 0px rgba(0, 0, 0, 0.1); 30 | } 31 | 32 | .close-button:hover { 33 | background-color: #af1c59; 34 | color: #fff; 35 | border: 2px solid #fff; 36 | } -------------------------------------------------------------------------------- /php/email_base/email_with_html_content.php: -------------------------------------------------------------------------------- 1 | 16 | 17 | HTML email 18 | 19 | 20 |

This email contains HTML Tags!

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
FirstnameLastname
JohnDoe
31 | 32 | 33 | "; 34 | 35 | // Always set content-type when sending HTML email 36 | $headers = "MIME-Version: 1.0" . "\r\n"; 37 | $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; 38 | 39 | // More headers 40 | $headers .= 'From: ' . "\r\n"; 41 | $headers .= 'Cc: myboss@example.com' . "\r\n"; 42 | 43 | mail($to,$subject,$message,$headers); 44 | ?> -------------------------------------------------------------------------------- /matlab/image_base/gistdescriptor/demoGist.m: -------------------------------------------------------------------------------- 1 | % Demo GIST descriptors based on original scripts from Oliva and Torralba 2 | % source: http://people.csail.mit.edu/torralba/code/spatialenvelope/ 3 | 4 | % EXAMPLE 5 | % Load image 6 | img1 = imread('../../../share/Lenna.png'); 7 | 8 | % Parameters: 9 | clear param 10 | %param.imageSize. If we do not specify the image size, the function LMgist 11 | % will use the current image size. If we specify a size, the function will 12 | % resize and crop the input to match the specified size. This is better when 13 | % trying to compute image similarities. 14 | param.imageSize = [256 256]; % it works also with non-square images 15 | param.orientationsPerScale = [8 8 8 8]; 16 | param.numberBlocks = 4; 17 | param.fc_prefilt = 4; 18 | 19 | % Computing gist requires 1) prefilter image, 2) filter image and collect 20 | % output energies 21 | tic 22 | [gist1, param] = LMgist(img1, '', param); 23 | toc 24 | 25 | % Visualization 26 | figure 27 | subplot(121) 28 | imshow(img1) 29 | title('Input image') 30 | subplot(122) 31 | showGist(gist1, param) 32 | title('Descriptor') 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /php/README.md: -------------------------------------------------------------------------------- 1 | # PHP 2 | 3 | ## Installation 4 | 5 | ### Apache 6 | 7 | Install Apache: 8 | 9 | sudo apt install apache2 10 | 11 | To start Apache: 12 | 13 | sudo systemctl start apache2 14 | 15 | You can enable Apache to start automatically on server boot: 16 | 17 | sudo systemctl enable apache2 18 | 19 | To check the status of the Apache web server and make sure it is up and running, you can use the following command: 20 | 21 | sudo systemctl status apache2 22 | 23 | To check that it is working, open your web browser and enter your server IP address, (e.g. http://your_server_ip_address). If Apache is successfully installed, you should see the Apache default welcome page. 24 | 25 | ### PHP 26 | 27 | Install PHP: 28 | 29 | sudo apt-get install php libapache2-mod-php sendmail. 30 | 31 | To test your installation and check that Apache, PHP and PHP extensions are working properly, create a new php info file: 32 | 33 | vim /var/www/html/phpinfo.php 34 | 35 | Add `` and open the file file using a web browser: `http:///phpinfo.php`. 36 | 37 | 38 | -------------------------------------------------------------------------------- /js/web/move_around/style.css: -------------------------------------------------------------------------------- 1 | /* Attribution: https://codepen.io/vajkri/pen/grgQmb */ 2 | 3 | @import url(https://fonts.googleapis.com/css?family=Libre+Baskerville:400,700); 4 | 5 | *, *:before, *:after { 6 | box-sizing: border-box; 7 | } 8 | 9 | html, body { 10 | height: 100%; 11 | } 12 | 13 | body { 14 | position: relative; 15 | padding: 20px; 16 | 17 | font-family: 'Libre Baskerville', serif; 18 | } 19 | 20 | h1 { 21 | margin: 0; 22 | padding: 0; 23 | 24 | position: absolute; 25 | top: 50%; 26 | left: 50%; 27 | 28 | color: white; 29 | font-size: 7vmin; 30 | text-align: center; 31 | text-transform: uppercase; 32 | 33 | transform: translate3d(-50%, -50%, 0); 34 | } 35 | 36 | .wrap { 37 | height: 100%; 38 | position: relative; 39 | overflow: hidden; 40 | } 41 | 42 | .wrap .bg { 43 | width: 100%; 44 | height: 100%; 45 | 46 | position: absolute; 47 | top: 0; 48 | left: 0; 49 | z-index: -1; 50 | 51 | background: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/167792/mountains_copy.jpg') no-repeat center center; 52 | background-size: cover; 53 | 54 | transform: scale(1.1); 55 | } -------------------------------------------------------------------------------- /matlab/numeric/derivate_data.m: -------------------------------------------------------------------------------- 1 | % This function derivates a vector or a matrix with respect to time 2 | 3 | function [xd xdd] = derivate_data(t,x) 4 | 5 | t = trajectoriesToColumns(t); 6 | x = trajectoriesToColumns(x); 7 | n_elements = length(t); 8 | 9 | 10 | if (length(x) ~= n_elements) 11 | error('Trajectory and time must have the same lenght'); 12 | end 13 | [n_trajectories vector_type] = min(size(x)); 14 | 15 | 16 | % Fitting and obtantion of velocity and acceleration 17 | options = fitoptions('Method','SmoothingSpline','SmoothingParam',0.999); %r² = 0.999 18 | xd = []; 19 | xdd = []; 20 | for i = 1:n_trajectories 21 | fit1 = fit(t,x(:,i),'SmoothingSpline',options); % Más lento, resultado = 22 | [qd qdd] = differentiate(fit1, t); % Es la derivada 23 | xd = [xd qd]; 24 | xdd = [xdd qdd]; 25 | % xm = x(1:10:end,i); 26 | % tm = t(1:10:end); 27 | % s = spline(tm,xm); 28 | % ds = fnder(s); 29 | % xd = [xd smooth(fnval(ds,t),20)]; 30 | % dds = fnder(ds); 31 | % xdd = [xdd smooth(fnval(dds,t),20)]; 32 | end 33 | 34 | % We return the solution with the same size of the input x 35 | if (vector_type == 1) 36 | xd = xd'; 37 | xdd = xdd'; 38 | end 39 | -------------------------------------------------------------------------------- /js/web/glowing_ball/style.css: -------------------------------------------------------------------------------- 1 | /* Attribution: */ 2 | 3 | *, *::before, *::after { 4 | box-sizing: border-box; 5 | } 6 | 7 | html, body { 8 | height: 100%; 9 | } 10 | 11 | body { 12 | display: grid; 13 | align-items: center; 14 | justify-items: center; 15 | margin: 0; 16 | background-color: #000; 17 | } 18 | 19 | .ball { 20 | width: 300px; 21 | height: 300px; 22 | border-radius: 50%; 23 | box-shadow: 24 | 0 0 20px #fff, 25 | -20px 0 80px #f0f, 26 | 20px 0 80px #0ff, 27 | inset 0 0 50px #fff, 28 | inset 50px 0 80px #f0f, 29 | inset -50px 0 80px #0ff, 30 | inset 50px 0 300px #f0f, 31 | inset -50px 0 300px #0ff; 32 | animation: pulsate 6s linear infinite; 33 | } 34 | 35 | @keyframes pulsate { 36 | 50% { 37 | box-shadow: 38 | 0 0 20px #fff, 39 | 20px 0 80px #f0f, 40 | -20px 0 80px #0ff, 41 | inset 0 0 50px #fff, 42 | inset -50px 0 80px #f0f, 43 | inset 50px 0 80px #0ff, 44 | inset -50px 0 300px #f0f, 45 | inset 50px 0 300px #0ff; 46 | } 47 | } -------------------------------------------------------------------------------- /minsc/VSCode.md: -------------------------------------------------------------------------------- 1 | # VSCode 2 | 3 | ## Configuration 4 | 5 | Use the contents in the file [vscode_settings.json](vscode_settings.json) to configure VSCode. 6 | 7 | To open and edit the configuration, there are these options: 8 | * General settings: These settings apply to all VSCode instances unless overwritten by local settings. The file can be accessed by clicking File, Preferences, Settings. Then press the icon oc Open Settings (JSON). 9 | * Local settings: In the project root create a the folder and file `.vscode/settings.json`. 10 | 11 | ## Remote execution 12 | 13 | For setting up the [SSH remote execution](https://code.visualstudio.com/docs/remote/ssh): 14 | 15 | 1. Install an OpenSSH compatible SSH client if one is not already present. 16 | 1. Install the [Remote Development extension pack](https://aka.ms/vscode-remote/download/extension). Via the extension tab, you can search for `Remote - SSH`. 17 | 1. In the Remote Explorer blade, press the wheel icon named Configure, select the file you want to save the configuration (i.e. `C:\Users\USERNAME\.ssh\config`), fill up the file following this pattern: 18 | 19 | ``` 20 | Host alias 21 | HostName hostname 22 | User user 23 | ``` 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Languages](https://img.shields.io/github/languages/count/miguelgfierro/codebase?style=flat&color=yellow)](https://api.github.com/repos/miguelgfierro/codebase/languages) 2 | [![Commits](https://img.shields.io/github/commit-activity/y/miguelgfierro/codebase.svg?style=flat&color=success)](https://github.com/miguelgfierro/codebase/commits/master) 3 | [![Last commit](https://img.shields.io/github/last-commit/miguelgfierro/codebase.svg?style=flat)](https://github.com/miguelgfierro/codebase/commits/master) 4 | 5 | [![Linkedin](https://img.shields.io/badge/Linkedin-Follow%20Miguel-blue?logo=linkedin)](https://www.linkedin.com/comm/mynetwork/discovery-see-all?usecase=PEOPLE_FOLLOWS&followMember=miguelgfierro) 6 | [![Blog](https://img.shields.io/badge/Blog-Visit%20miguelgfierro.com-blue.svg)](https://miguelgfierro.com?utm_source=github&utm_medium=profile&utm_campaign=codebase) 7 | 8 | # Codebase for programming projects 9 | 10 | This is a codebase of useful code pieces in multiple programming languages that I have used in my projects. 11 | 12 | To clone: 13 | 14 | git clone --recursive git@github.com:miguelgfierro/codebase.git 15 | 16 | To update the submodules: 17 | 18 | git submodule update --remote --merge 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /js/web/form_fancy_border/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |

Join my newsletter

18 |

You like articles of the blog? Sign up for updates via email.

19 |
20 | 21 | 22 |
23 |
24 |
25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /js/web/popup_after_delay_cookies/style.css: -------------------------------------------------------------------------------- 1 | /* Attribution: https://www.sitepoint.com/show-modal-popup-after-time-delay/ */ 2 | 3 | body, 4 | html { 5 | font-family: arial; 6 | background: #fffff0; 7 | color: #8f1f08; 8 | font-size: 20px; 9 | line-height: 1.3; 10 | margin: 0; 11 | padding: 0; 12 | } 13 | 14 | #container { 15 | width: 650px; 16 | padding: 10px; 17 | margin: 0 auto; 18 | } 19 | 20 | h1, 21 | h2 { 22 | color: #2B292E 23 | } 24 | 25 | input { 26 | border: 1px solid #333; 27 | margin-bottom: 15px; 28 | min-width: 250px; 29 | padding: 8px; 30 | } 31 | 32 | .button { 33 | transition-duration: 0.4s; 34 | background: #720000; 35 | border: none; 36 | color: white; 37 | padding: 10px 20px; 38 | display: block; 39 | font-size: 16px; 40 | margin: 10px 2px; 41 | cursor: pointer; 42 | } 43 | 44 | button.button:hover { 45 | background: #990000 46 | } 47 | 48 | #cboxLoadedContent { 49 | padding: 10px; 50 | background: #fffff0; 51 | } 52 | 53 | #modal-content { 54 | display: none; 55 | } 56 | 57 | #modal-content label { 58 | display: block; 59 | margin-bottom: 5px; 60 | } 61 | 62 | #modal-content input { 63 | width: 95%; 64 | } -------------------------------------------------------------------------------- /command_line/pip_info.txt: -------------------------------------------------------------------------------- 1 | # Tools for pip packages 2 | 3 | # Create an environment named py36 inside folder env 4 | python -m venv env\py36 5 | 6 | # Create an environment named py36 inside folder env with a particular python version (Linux) 7 | sudo add-apt-repository ppa:deadsnakes/ppa 8 | sudo apt-get update 9 | sudo apt-get install python3.6 python3-virtualenv 10 | virtualenv env/py36 -p /usr/bin/python3.6 11 | 12 | # Activate environment py36 (Windows) 13 | .\env\py36\Scripts\activate 14 | 15 | # Activate environment py36 (Linux) 16 | source env/py36/bin/activate 17 | 18 | # List all installed packages ordered by size 19 | # Source: https://stackoverflow.com/a/51571259/5620182 20 | pip list --format freeze|awk -F = {'print $1'}| xargs pip show | grep -E 'Location:|Name:' | cut -d ' ' -f 2 | paste -d ' ' - - | awk '{print $2 "/" tolower($1)}' | xargs du -sh 2> /dev/null|sort -h 21 | 22 | # List the dependencies of a python library 23 | pipdeptree -p library_name 24 | 25 | # Print a dependency graph (requires the instalation of http://www.graphviz.org/ 26 | pip install graphviz 27 | pipdeptree -p library_name --graph-output svg > dependencies.svg 28 | 29 | # Uninstall libraries based on a pattern 30 | pip uninstall -y $(pip list | grep pattern | awk '{print $1}') 31 | -------------------------------------------------------------------------------- /js/web/toggle_hidding_showing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 16 | 17 | 18 | 19 | 20 |

Click the "Try it" button to toggle between hiding and showing the DIV element:

21 | 22 | 23 | 24 |
25 | This is my DIV element. 26 |
27 | 28 |

Note: The element will not take up any space when the display property set to "none".

29 | 30 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /js/xml_http_request/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Practice AJAX 8 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
32 |
33 | 34 | 35 | -------------------------------------------------------------------------------- /command_line/linux/paths.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #Find a text inside files in a directory. 4 | #-r or -R is recursive, 5 | #-n is line number, and 6 | #-w stands for match the whole word. 7 | grep -rnw '/path/to/somewhere/' -e 'text' 8 | 9 | 10 | # Extract the version of a python init file 11 | # E.g.: a __init__.py with __version__ = "0.1.5" 12 | # The output of the following command is 0.1.5 13 | awk '/__version__ = / {print $3}' __init__.py | sed 's/"//g' 14 | 15 | 16 | #Find files modified between dates 17 | find . -newermt 'Oct 3 00:00' ! -newermt 'Oct 4 00:00' -ls 18 | 19 | 20 | #Count files in a folder recursively 21 | find DIR_NAME -type f | wc -l 22 | 23 | 24 | #Remove files from a directory leaving a certain number, ex:100 25 | ls -1tr | head -n -100 | xargs -d '\n' rm -f -- 26 | 27 | 28 | #Remove recursively all files with a name 29 | find . -type f -name '.DS_Store' -delete 30 | 31 | 32 | #Remove recursively all files with a pattern 33 | find . -type f -name '*.db' -delete 34 | 35 | 36 | #Remove files modified between dates 37 | find . -newermt 'Oct 3 00:00' ! -newermt 'Oct 4 00:00' -delete 38 | 39 | 40 | # Remove all files and folders except those with a pattern "*.yaml" 41 | find my_folder ! -name "*.yaml" 42 | find my_folder ! -name "*.yaml" -delete 2>/dev/null # Ignore warning outputs 43 | 44 | 45 | -------------------------------------------------------------------------------- /js/web/star_background/style.css: -------------------------------------------------------------------------------- 1 | /* Attribution: https://github.com/matteobruni/tsparticles */ 2 | 3 | body { 4 | margin: 0; 5 | font: normal 75% Arial, Helvetica, sans-serif; 6 | } 7 | canvas { 8 | display: block; 9 | vertical-align: bottom; 10 | } 11 | /* ---- tsparticles container ---- */ 12 | #tsparticles { 13 | position: absolute; 14 | width: 100%; 15 | height: 100%; 16 | background-color: #000; /*#232741;*/ 17 | background-image: url("http://cdn.matteobruni.it/images/spacex-logo-black-and-white.png"); 18 | background-repeat: no-repeat; 19 | background-size: 40%; 20 | background-position: 50% 50%; 21 | } 22 | 23 | .github { 24 | bottom: 10px; 25 | right: 10px; 26 | position: fixed; 27 | border-radius: 10px; 28 | background: #fff; 29 | padding: 0 12px 6px 12px; 30 | border: 1px solid #000; 31 | } 32 | 33 | .github a:hover, 34 | .github a:link, 35 | .github a:visited, 36 | .github a:active { 37 | color: #000; 38 | text-decoration: none; 39 | } 40 | 41 | .github img { 42 | height: 30px; 43 | } 44 | 45 | .github #gh-project { 46 | font-size: 20px; 47 | padding-left: 5px; 48 | font-weight: bold; 49 | vertical-align: bottom; 50 | } 51 | -------------------------------------------------------------------------------- /cpp/numeric/math_utils.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Based on https://github.com/rgbdemo/nestk/blob/master/ntk/numeric/utils.h 3 | */ 4 | 5 | #ifndef MATH_UTILS_HPP 6 | #define MATH_UTILS_HPP 7 | 8 | #include 9 | #include "math_constants.hpp" 10 | 11 | inline double radToDeg(double rad_angle) { return (rad_angle*180.0)/math::pi; } 12 | inline double degToRad(double deg_angle) { return (deg_angle*math::pi)/180.0; } 13 | 14 | template 15 | inline bool inRange(T lower, U data, T upper){ 16 | return (data >= lower) && (data <= upper); 17 | } 18 | 19 | inline bool equalFloat (float lhs, float rhs, 20 | float epsilon = std::numeric_limits::epsilon()){ 21 | return std::abs(lhs - rhs) <= epsilon; 22 | } 23 | 24 | inline bool lessOrEqualFloat(float lhs, float rhs, 25 | float epsilon = std::numeric_limits::epsilon()){ 26 | return lhs <= (rhs+epsilon); 27 | } 28 | 29 | inline bool greaterOrEqualFloat(float lhs, float rhs, 30 | float epsilon = std::numeric_limits::epsilon()){ 31 | return (lhs+epsilon) >= rhs; 32 | } 33 | 34 | inline bool isEven(int num){ 35 | if (num % 2 == 0) return true; 36 | else return false; 37 | } 38 | 39 | inline bool isOdd(int num){ 40 | if (num % 2 == 0) return false; 41 | else return true; 42 | } 43 | 44 | #endif //MATH_UTILS_HPP 45 | -------------------------------------------------------------------------------- /js/web/infinite_photo_grid/style.css: -------------------------------------------------------------------------------- 1 | /* Attribution: https://codepen.io/s1mpson/pen/BajjYmp */ 2 | 3 | body { 4 | display: flex; 5 | flex-direction: row; 6 | justify-content: center; 7 | align-content: center; 8 | align-items: center; 9 | flex-wrap: wrap; 10 | width: 100vw; 11 | height: 100vh; 12 | } 13 | 14 | .infinite-photo-grid { 15 | width: 100%; 16 | height: 100%; 17 | max-height: 750px; 18 | /*background-image: url(https://raw.githubusercontent.com/s1mpson/-/master/codepen/infinite-photo-grid/photo-grid.jpg);*/ 19 | background-image: url(photo-grid.jpg); 20 | background-size: calc(4.84 * min(100vh, 750px)) min(100vh, 750px); 21 | background-repeat: repeat-x; 22 | animation: scroll 50s linear infinite; 23 | will-change: background-position; 24 | } 25 | 26 | @keyframes scroll { 27 | from { 28 | background-position: left calc(4.84 * min(100vh, 750px)) top 0px; 29 | } 30 | to { 31 | background-position: left 0px top 0px; 32 | } 33 | } 34 | 35 | .s1mpson { 36 | background: #222; 37 | border-radius: 6px; 38 | box-shadow: 0px 0px 0px 8px #222, 39 | 0 10px 30px rgba(65, 72, 86, 1); 40 | } 41 | 42 | .s1mpson-twitter-icon { 43 | fill: #FFF; 44 | } 45 | .s1mpson-github-icon { 46 | fill: #FFF; 47 | } -------------------------------------------------------------------------------- /command_line/linux/compress.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #7z create an archive 4 | 7z a folder.7z folder 5 | 6 | #7z extract an archive 7 | 7z x folder.7z 8 | 9 | #zip create an archive 10 | zip -r folder.zip folder 11 | 12 | #zip extract an archive 13 | unzip folder.zip 14 | 15 | #zip extract many zip files 16 | unzip '*.zip' 17 | 18 | #tar create an archive 19 | tar -cvf folder.tar folder 20 | 21 | #tar.gz create an archive 22 | tar -czvf folder.tar.gz folder 23 | 24 | #tar extract an archive 25 | tar -xvf folder.tar 26 | 27 | #tar.gz/tgz extract an archive 28 | tar -zxvf folder.tar.gz 29 | tar -zxvf folder.tgz 30 | 31 | #tar extract an archive created from a folder to a folder 32 | #NOTE: if you don't add --strip-components=1, then the structure will be folder/folder/file1.txt 33 | #instead of folder/file1.txt 34 | mkdir folder && tar -xvf folder.tar -C folder --strip-components=1 35 | 36 | #tar.gz extract an archive created from a folder to a folder 37 | #NOTE: if you don't add --strip-components=1, then the structure will be folder/folder/file1.txt 38 | #instead of folder/file1.txt 39 | mkdir folder && tar -zxvf folder.tar.gz -C folder --strip-components=1 40 | 41 | #Extract multiple tar files into folder with the tar name and remove the tar file 42 | find . -name "*.tar" | while read NAME ; do mkdir -p "${NAME%.tar}"; tar -xvf "${NAME}" -C "${NAME%.tar}"; rm -f "${NAME}"; done 43 | 44 | -------------------------------------------------------------------------------- /js/web/borderless_youtube/index.html: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 |
22 | 23 | 24 | 25 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /minsc/Preferences.sublime-settings: -------------------------------------------------------------------------------- 1 | { 2 | "added_words": 3 | [ 4 | "blog", 5 | "https", 6 | "png", 7 | "jpg", 8 | "jpeg", 9 | "txt", 10 | "py", 11 | "js", 12 | "jquery", 13 | "nodejs", 14 | "exe", 15 | "cmd", 16 | "cpp", 17 | "href", 18 | "url", 19 | "async", 20 | "json", 21 | "src", 22 | "img", 23 | "www", 24 | "gpu", 25 | "hoaphumanoid", 26 | "miguelgfierro", 27 | "gmail", 28 | "conda", 29 | "cd", 30 | "ubuntu", 31 | "git", 32 | "github", 33 | "repo", 34 | "uninstall", 35 | "lightgbm", 36 | "cntk", 37 | "tensorflow", 38 | "tf", 39 | "mxnet", 40 | "casper", 41 | "linkedin", 42 | "google", 43 | "microsoft", 44 | "facebook", 45 | "config", 46 | "app", 47 | "utils" 48 | ], 49 | "color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme", 50 | "dictionary": "Packages/Language - English/en_US.dic", 51 | "ensure_newline_at_eof_on_save": true, 52 | "ignored_packages": 53 | [ 54 | "Vintage" 55 | ], 56 | "rulers": 57 | [ 58 | 80 59 | ], 60 | "show_encoding": true, 61 | "spell_check": true, 62 | "translate_tabs_to_spaces": true 63 | } 64 | -------------------------------------------------------------------------------- /js/web/popup_after_delay_cookies/code.js: -------------------------------------------------------------------------------- 1 | // Attribution: https://www.sitepoint.com/show-modal-popup-after-time-delay/ 2 | 3 | $(".clear-cookie").on("click", function () { 4 | Cookies.remove('colorboxShown'); 5 | $(this).replaceWith("

Cookie cleared. Re-run demo

"); 6 | }); 7 | 8 | $(".order-cheezburger").on("click", function () { 9 | $.colorbox.close(); 10 | }); 11 | 12 | function onPopupOpen() { 13 | $("#modal-content").show(); 14 | $("#yurEmail").focus(); 15 | } 16 | 17 | function onPopupClose() { 18 | $("#modal-content").hide(); 19 | Cookies.set('colorboxShown', 'yes', { 20 | expires: 1 21 | }); 22 | $(".clear-cookie").fadeIn(); 23 | lastFocus.focus(); 24 | } 25 | 26 | function displayPopup() { 27 | $.colorbox({ 28 | inline: true, 29 | href: "#modal-content", 30 | className: "cta", 31 | width: 600, 32 | height: 350, 33 | onComplete: onPopupOpen, 34 | onClosed: onPopupClose 35 | }); 36 | } 37 | 38 | var lastFocus; 39 | var popupShown = Cookies.get('colorboxShown'); 40 | 41 | if (popupShown) { 42 | console.log("Cookie found. No action necessary"); 43 | $(".clear-cookie").show(); 44 | } else { 45 | console.log("No cookie found. Opening popup in 3 seconds"); 46 | $(".clear-cookie").hide(); 47 | setTimeout(function () { 48 | lastFocus = document.activeElement; 49 | displayPopup(); 50 | }, 3000); 51 | } -------------------------------------------------------------------------------- /js/web/floating_balls/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |

Miguel González-Fierro

16 |

Sorcerer's apprentice

17 |
    18 |
  • mitch_buchannon@ohyeah.com
  • 19 |
  • 20 | Blog
  • 21 |
  • 22 | Twitter
  • 23 |
  • LinkedIn
  • 24 |
25 |
26 | 27 |
28 |
29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /js/web/rotating_text/style.css: -------------------------------------------------------------------------------- 1 | /* Attribution: https://codepen.io/rachsmith/pen/BNKJme */ 2 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:600); 3 | 4 | body { 5 | font-family: 'Open Sans', sans-serif; 6 | font-weight: 600; 7 | font-size: 40px; 8 | } 9 | 10 | .text { 11 | position: absolute; 12 | width: 450px; 13 | left: 50%; 14 | margin-left: -225px; 15 | height: 40px; 16 | top: 50%; 17 | margin-top: -20px; 18 | } 19 | 20 | p { 21 | display: inline-block; 22 | vertical-align: top; 23 | margin: 0; 24 | } 25 | 26 | .word { 27 | position: absolute; 28 | width: 220px; 29 | opacity: 0; 30 | } 31 | 32 | .letter { 33 | display: inline-block; 34 | position: relative; 35 | float: left; 36 | transform: translateZ(25px); 37 | transform-origin: 50% 50% 25px; 38 | } 39 | 40 | .letter.out { 41 | transform: rotateX(90deg); 42 | transition: transform 0.32s cubic-bezier(0.55, 0.055, 0.675, 0.19); 43 | } 44 | 45 | .letter.behind { 46 | transform: rotateX(-90deg); 47 | } 48 | 49 | .letter.in { 50 | transform: rotateX(0deg); 51 | transition: transform 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275); 52 | } 53 | 54 | .wisteria { 55 | color: #8e44ad; 56 | } 57 | 58 | .belize { 59 | color: #2980b9; 60 | } 61 | 62 | .pomegranate { 63 | color: #c0392b; 64 | } 65 | 66 | .green { 67 | color: #16a085; 68 | } 69 | 70 | .midnight { 71 | color: #2c3e50; 72 | } 73 | -------------------------------------------------------------------------------- /sql/sql_server/select_values.sql: -------------------------------------------------------------------------------- 1 | -- Cheatsheet: https://github.com/FavioVazquez/ds-cheatsheets/blob/master/SQL/SQL-cheat-sheet.pdf 2 | 3 | -- Select all entries equal to a value in a column 4 | SELECT * FROM table_name WHERE column_name = value; 5 | 6 | -- Select data in columns column_name1, column_name2 from a table 7 | SELECT column_name1, column_name2 FROM table_name; 8 | 9 | -- Select distinct rows from a table 10 | SELECT DISTINCT column_name FROM table_name WHERE column_name = value; 11 | 12 | -- Select top N values of specific column names 13 | SELECT TOP (5) column_name1, column_name2 FROM table_name; 14 | 15 | -- Select the last entry equal to a value in a column ordered by other column 16 | SELECT TOP(1) * FROM table_name 17 | WHERE column_name = value ORDER BY time_stamp DESC; 18 | 19 | -- Skip offset of rows and return the next n rows 20 | SELECT column_name1, column_name2 FROM table_name 21 | ORDER BY column_name1 LIMIT n OFFSET offset; 22 | 23 | -- Query rows using pattern matching %, _ 24 | SELECT column_name1, column_name2 FROM t1 25 | WHERE column_name1 [NOT] LIKE pattern; 26 | 27 | -- Query rows in a list 28 | SELECT column_name1, column_name2 FROM table_name 29 | WHERE column_name1 [NOT] IN value_list; 30 | 31 | -- Query rows between two values 32 | SELECT column_name1, column_name2 FROM table_name 33 | WHERE column_name1 BETWEEN low AND high; 34 | 35 | -- Check if values in a table is NULL or not 36 | SELECT column_name1, column_name2 FROM table_name 37 | WHERE column_name1 IS [NOT] NULL; -------------------------------------------------------------------------------- /js/web/exit_popup_cookies/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | After 2 seconds, move your mouse cursor above this page. 14 |
15 |
16 |
17 |
18 |
19 |

Social media, Hacks & Security news. Delivered weekly.

20 | 21 |

Join thousands of readers who get our content first.

22 |
24 |

25 | 26 |

27 |

28 | 29 |

30 |
31 |

Give it a try. It only takes a click to unsubscribe.

32 |
33 |
34 |
35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /command_line/docker/mxnet_distributed/dockerfile: -------------------------------------------------------------------------------- 1 | # Dockerfile for MXNet version 1.2 built from source in distributed mode 2 | # With CUDA, CuDNN, OpenCV, OpenBlas and KVStore distributed 3 | # Uploaded to dockerhub: https://hub.docker.com/r/hoaphumanoid/mxnet_dist/ 4 | 5 | FROM nvidia/cuda:8.0-cudnn7-devel-ubuntu16.04 6 | 7 | RUN apt-get update && apt-get install -y --no-install-recommends apt-utils \ 8 | && apt-get install -y build-essential git wget curl \ 9 | && apt-get install -y libopenblas-dev liblapack-dev \ 10 | && apt-get install -y libopencv-dev libopenmpi-dev 11 | 12 | ENV PYTHON_VERSION=3.6 13 | RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ 14 | chmod +x ~/miniconda.sh && \ 15 | ~/miniconda.sh -b -p /opt/conda && \ 16 | rm ~/miniconda.sh && \ 17 | /opt/conda/bin/conda create -y --name py$PYTHON_VERSION python=$PYTHON_VERSION numpy pyyaml scipy \ 18 | ipython mkl pandas jupyter ipykernel scikit-learn scipy && \ 19 | /opt/conda/bin/conda clean -ya 20 | ENV PATH /opt/conda/envs/py$PYTHON_VERSION/bin:$PATH 21 | 22 | RUN git clone --recursive https://github.com/apache/incubator-mxnet \ 23 | && cd incubator-mxnet \ 24 | && git checkout 1.2.0.rc3 \ 25 | && git submodule update \ 26 | && make -j $(nproc) USE_OPENCV=1 USE_BLAS=openblas USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1 USE_DIST_KVSTORE=1 \ 27 | && cd python \ 28 | && pip install -e . 29 | 30 | 31 | 32 | WORKDIR /workspace 33 | RUN chmod -R a+w /workspace 34 | 35 | -------------------------------------------------------------------------------- /command_line/windows/WSL.md: -------------------------------------------------------------------------------- 1 | # Windows Subsystem for Linux (WSL) 2 | 3 | 4 | ## Installation 5 | 6 | To run the `wsl` command, use a command promp with admin rights. 7 | 8 | To list the current distributions: 9 | 10 | wsl -l 11 | 12 | To list all available distributions: 13 | 14 | wsl -l --online 15 | 16 | To install one of the default distributions: 17 | 18 | wsl --install 19 | 20 | To install one, just add the distribution name: 21 | 22 | wsl --install Ubuntu-20.04 23 | 24 | For installing older distributions like Ubuntu 16.04: https://docs.microsoft.com/en-us/windows/wsl/install-manual. Download the file and execute. 25 | 26 | ## Configure WSL memory 27 | 28 | First, close all open WSL-2 and open CMD, enter the following command: 29 | 30 | wsl --shutdown 31 | 32 | Put the following settings into `C:\Users\\.wslconfig`. Remember DON'T ADD THE EXTENSION AT THE END. The settings in `.wslconfig` are as follows: 33 | 34 | [wsl2] 35 | memory=32GB # Limits Ubuntu memory 36 | 37 | Save and quit, restart WSL-2, you can use htop command to check, it should reflect the whole memory for you. 38 | 39 | ## Compact the VHDX file 40 | 41 | The VHDX file is the file in Windows that contains Ubuntu. After cleaning files in Ubuntu, the VHDX file can have the same size. To compact it go to CMD: 42 | 43 | ```cmd 44 | wsl --shutdown 45 | diskpart 46 | select vdisk file="C:\Users\hoaph\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\ext4.vhdx" 47 | compact vdisk 48 | exit 49 | ``` 50 | 51 | 52 | -------------------------------------------------------------------------------- /js/web/star_wars/code.js: -------------------------------------------------------------------------------- 1 | // Attribution: https://codepen.io/donovanh/pen/pJzwEw 2 | 3 | /* Learn how to create this and much more with this email course: 4 | 5 | https://cssanimation.rocks/courses/animation-101/ 6 | 7 | MANY THANKS TO @tadywankenobi for the following JS to handle the text in the byline: 8 | 9 | The following JS takes in the byline and splits it into letters, each one wrapped in a span. We need to create the spans as nodes, we can't just add them to the HTML using innerHTML, as to do so would mean the CSS won't affect the span because it doesn't recognise the tag as existing. It's an old problem we run into time and again. 10 | 11 | */ 12 | 13 | var byline = document.getElementById('byline'); // Find the H2 14 | bylineText = byline.innerHTML; // Get the content of the H2 15 | bylineArr = bylineText.split(''); // Split content into array 16 | byline.innerHTML = ''; // Empty current content 17 | 18 | var span; // Create variables to create elements 19 | var letter; 20 | 21 | for (i = 0; i < bylineArr.length; i++) { // Loop for every letter 22 | span = document.createElement("span"); // Create a element 23 | letter = document.createTextNode(bylineArr[i]); // Create the letter 24 | if (bylineArr[i] == ' ') { // If the letter is a space... 25 | byline.appendChild(letter); // ...Add the space without a span 26 | } else { 27 | span.appendChild(letter); // Add the letter to the span 28 | byline.appendChild(span); // Add the span to the h2 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD License 2 | 3 | Copyright (c) 2016-present, Miguel González-Fierro. All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | * Neither the name Miguel González-Fierro nor the names of its contributors may be used to 16 | endorse or promote products derived from this software without specific 17 | prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 23 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 26 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /js/web/popup_after_delay_cookies/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Delayed modal demo 9 | 10 | 11 | 12 | 13 | 14 |
15 |

My Awesome Site

16 | 17 |

Please subscribe to my newsletter.

18 |

It's very important and I promise not to misuse your email address.

19 |

Although, saying that, I might sell it.

20 |

I mean, I gotta earn a living, right?

21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 |
29 |

I Can Haz Email?

30 | 31 | 32 | 33 |
34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /js/web/accordion/style.css: -------------------------------------------------------------------------------- 1 | /* Attribution: https://codepen.io/Sp00ky/pen/rLyjPN */ 2 | body { 3 | color: #6a6c6f; 4 | background-color: #f1f3f6; 5 | margin-top:30px; 6 | } 7 | 8 | .container { 9 | max-width: 960px; 10 | } 11 | 12 | 13 | /* */ 14 | 15 | .panel-default>.panel-heading { 16 | color: #333; 17 | background-color: #fff; 18 | border-color: #e4e5e7; 19 | padding: 0; 20 | -webkit-user-select: none; 21 | -moz-user-select: none; 22 | -ms-user-select: none; 23 | user-select: none; 24 | } 25 | 26 | .panel-default>.panel-heading a { 27 | display: block; 28 | padding: 10px 15px; 29 | } 30 | 31 | .panel-default>.panel-heading a:after { 32 | content: ""; 33 | position: relative; 34 | top: 1px; 35 | display: inline-block; 36 | font-family: 'Glyphicons Halflings'; 37 | font-style: normal; 38 | font-weight: 400; 39 | line-height: 1; 40 | -webkit-font-smoothing: antialiased; 41 | -moz-osx-font-smoothing: grayscale; 42 | float: right; 43 | transition: transform .25s linear; 44 | -webkit-transition: -webkit-transform .25s linear; 45 | } 46 | 47 | .panel-default>.panel-heading a[aria-expanded="true"] { 48 | background-color: #eee; 49 | } 50 | 51 | .panel-default>.panel-heading a[aria-expanded="true"]:after { 52 | content: "\2212"; 53 | -webkit-transform: rotate(180deg); 54 | transform: rotate(180deg); 55 | } 56 | 57 | .panel-default>.panel-heading a[aria-expanded="false"]:after { 58 | content: "\002b"; 59 | -webkit-transform: rotate(90deg); 60 | transform: rotate(90deg); 61 | } -------------------------------------------------------------------------------- /js/web/rotating_text/code.js: -------------------------------------------------------------------------------- 1 | // Attribution: https://codepen.io/rachsmith/pen/BNKJme 2 | 3 | var words = document.getElementsByClassName('word'); 4 | var wordArray = []; 5 | var currentWord = 0; 6 | 7 | words[currentWord].style.opacity = 1; 8 | for (var i = 0; i < words.length; i++) { 9 | splitLetters(words[i]); 10 | } 11 | 12 | function changeWord() { 13 | var cw = wordArray[currentWord]; 14 | var nw = currentWord == words.length - 1 ? wordArray[0] : wordArray[currentWord + 1]; 15 | for (var i = 0; i < cw.length; i++) { 16 | animateLetterOut(cw, i); 17 | } 18 | 19 | for (var i = 0; i < nw.length; i++) { 20 | nw[i].className = 'letter behind'; 21 | nw[0].parentElement.style.opacity = 1; 22 | animateLetterIn(nw, i); 23 | } 24 | 25 | currentWord = (currentWord == wordArray.length - 1) ? 0 : currentWord + 1; 26 | } 27 | 28 | function animateLetterOut(cw, i) { 29 | setTimeout(function () { 30 | cw[i].className = 'letter out'; 31 | }, i * 80); 32 | } 33 | 34 | function animateLetterIn(nw, i) { 35 | setTimeout(function () { 36 | nw[i].className = 'letter in'; 37 | }, 340 + (i * 80)); 38 | } 39 | 40 | function splitLetters(word) { 41 | var content = word.innerHTML; 42 | word.innerHTML = ''; 43 | var letters = []; 44 | for (var i = 0; i < content.length; i++) { 45 | var letter = document.createElement('span'); 46 | letter.className = 'letter'; 47 | letter.innerHTML = content.charAt(i); 48 | word.appendChild(letter); 49 | letters.push(letter); 50 | } 51 | 52 | wordArray.push(letters); 53 | } 54 | 55 | changeWord(); 56 | setInterval(changeWord, 4000); 57 | 58 | -------------------------------------------------------------------------------- /js/web/footer_waves/style.css: -------------------------------------------------------------------------------- 1 | /* Attribution: https://codepen.io/Cancepto/pen/OMQdJx */ 2 | 3 | @keyframes move_wave { 4 | 0% { 5 | transform: translateX(0) translateZ(0) scaleY(1) 6 | } 7 | 50% { 8 | transform: translateX(-25%) translateZ(0) scaleY(0.55) 9 | } 10 | 100% { 11 | transform: translateX(-50%) translateZ(0) scaleY(1) 12 | } 13 | } 14 | .waveWrapper { 15 | overflow: hidden; 16 | position: absolute; 17 | left: 0; 18 | right: 0; 19 | bottom: 0; 20 | top: 0; 21 | margin: auto; 22 | } 23 | .waveWrapperInner { 24 | position: absolute; 25 | width: 100%; 26 | overflow: hidden; 27 | height: 100%; 28 | bottom: -1px; 29 | background-image: linear-gradient(to top, #86377b 20%, #27273c 80%); 30 | } 31 | .bgTop { 32 | z-index: 15; 33 | opacity: 0.5; 34 | } 35 | .bgMiddle { 36 | z-index: 10; 37 | opacity: 0.75; 38 | } 39 | .bgBottom { 40 | z-index: 5; 41 | } 42 | .wave { 43 | position: absolute; 44 | left: 0; 45 | width: 200%; 46 | height: 100%; 47 | background-repeat: repeat no-repeat; 48 | background-position: 0 bottom; 49 | transform-origin: center bottom; 50 | } 51 | .waveTop { 52 | background-size: 50% 100px; 53 | } 54 | .waveAnimation .waveTop { 55 | animation: move-wave 3s; 56 | -webkit-animation: move-wave 3s; 57 | -webkit-animation-delay: 1s; 58 | animation-delay: 1s; 59 | } 60 | .waveMiddle { 61 | background-size: 50% 120px; 62 | } 63 | .waveAnimation .waveMiddle { 64 | animation: move_wave 10s linear infinite; 65 | } 66 | .waveBottom { 67 | background-size: 50% 100px; 68 | } 69 | .waveAnimation .waveBottom { 70 | animation: move_wave 15s linear infinite; 71 | } -------------------------------------------------------------------------------- /js/web/popup_close_button_css/style.css: -------------------------------------------------------------------------------- 1 | /* Attribution: https://stackoverflow.com/questions/29345016/auto-popup-with-close-button-using-html-css */ 2 | 3 | .box { 4 | width: 20%; 5 | margin: 0 auto; 6 | background: rgba(255, 255, 255, 0.2); 7 | padding: 35px; 8 | border: 2px solid #fff; 9 | border-radius: 20px/50px; 10 | background-clip: padding-box; 11 | text-align: center; 12 | } 13 | 14 | .button { 15 | font-size: 1em; 16 | padding: 10px; 17 | color: #000; 18 | border: 2px solid orange; 19 | border-radius: 20px/50px; 20 | text-decoration: none; 21 | cursor: pointer; 22 | transition: all 0.3s ease-out; 23 | } 24 | 25 | .button:hover { 26 | background: orange; 27 | } 28 | 29 | .overlay { 30 | position: absolute; 31 | top: 0; 32 | bottom: 0; 33 | left: 0; 34 | right: 0; 35 | background: rgba(0, 0, 0, 0.7); 36 | transition: opacity 500ms; 37 | visibility: hidden; 38 | opacity: 0; 39 | } 40 | 41 | .overlay:target { 42 | visibility: visible; 43 | opacity: 1; 44 | } 45 | 46 | .popup { 47 | margin: 70px auto; 48 | padding: 20px; 49 | background: #fff; 50 | border-radius: 5px; 51 | width: 30%; 52 | position: relative; 53 | transition: all 5s ease-in-out; 54 | } 55 | 56 | .popup h2 { 57 | margin-top: 0; 58 | color: #333; 59 | font-family: Tahoma, Arial, sans-serif; 60 | } 61 | 62 | .popup .close { 63 | position: absolute; 64 | top: 20px; 65 | right: 30px; 66 | transition: all 200ms; 67 | font-size: 30px; 68 | font-weight: bold; 69 | text-decoration: none; 70 | color: #333; 71 | } 72 | 73 | .popup .close:hover { 74 | color: orange; 75 | } 76 | 77 | .popup .content { 78 | max-height: 30%; 79 | overflow: auto; 80 | } -------------------------------------------------------------------------------- /cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED (VERSION 2.6) 2 | SET(KEYWORD codebase) 3 | 4 | # Start a project 5 | PROJECT(${KEYWORD}) 6 | 7 | # Define system type 8 | IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") 9 | ADD_DEFINITIONS(-DSYSTEMTYPE_LINUX) 10 | set(SYSTEM_FOLDER_NAME linux) 11 | ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows") 12 | ADD_DEFINITIONS(-DSYSTEMTYPE_WINDOWS) 13 | set(SYSTEM_FOLDER_NAME windows) 14 | ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 15 | ADD_DEFINITIONS(-DSYSTEMTYPE_MAC) 16 | SET(SYSTEM_FOLDER_NAME mac) 17 | ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") 18 | 19 | # Define standard paths. 20 | set(MY_OUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/out/${SYSTEM_FOLDER_NAME}) 21 | set(MY_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src) 22 | 23 | # Search for source code. 24 | SET (SOURCES 25 | playground.cpp 26 | log/timer.hpp 27 | numeric/math_constants.hpp 28 | numeric/math_utils.hpp 29 | io/read_file.cpp 30 | io/read_file.hpp 31 | ) 32 | 33 | SET(MY_OUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/out/${SYSTEM_FOLDER_NAME}) 34 | SET(MY_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR}/ssm) 35 | SET(EXECUTABLE_OUTPUT_PATH ${MY_OUT_PATH}) 36 | 37 | # Automatically add include directories if needed. 38 | #FOREACH(header_file ${folder_header}) 39 | # GET_FILENAME_COMPONENT(p ${header_file} PATH) 40 | # INCLUDE_DIRECTORIES(${p}) 41 | #ENDFOREACH(header_file ${folder_header}) 42 | 43 | # Set location for binary output 44 | set(EXECUTABLE_OUTPUT_PATH ${MY_OUT_PATH}) 45 | ADD_EXECUTABLE(${KEYWORD} ${SOURCES}) 46 | 47 | # Set up our main executable. 48 | #IF (folder_source) 49 | # ADD_EXECUTABLE(${KEYWORD} ${folder_source} ${folder_header}) 50 | #ELSE (folder_source) 51 | # MESSAGE(FATAL_ERROR "No source code files found. Please add something") 52 | #ENDIF (folder_source) 53 | 54 | 55 | -------------------------------------------------------------------------------- /latex/thesis/Capitulo7/ch_conclusions.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | %2345678901234567890123456789012345678901234567890123456789012345678901234567890 3 | % 1 2 3 4 5 6 7 8 4 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5 | \chapter{Conclusions and Future Works}\label{ch_conclusions} 6 | \textit{ This thesis has attempted to contribute in some areas related to posture behavior of humanoid robots. From the beginning, this work has had a differential feature if it is compared with a usual Ph.D. thesis. It has an initial framework which is the center of all developed studies. The framework is the high level order \robotorder that the robot needs to acomplish. To execute that order, the humanoid robot needs to perform a set of movements, it needs to avoid a series of obstacles and it needs to adopt a determined posture or set of postures. All needed procedures to successfully achieve this order are gathered in this thesis. The amount of contributions that this thesis has generated are related to learning from demonstration, reinforcement learning, non-linear control and motion planning. In this chapter the conclusions of this thesis are summarized and a discussion of the positive as well as the negative aspects of the developed work is presented. There are also proposed some future lines of development that can be used to improve the current work or to serve as a start point for new developments. } 7 | \newpage 8 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9 | %\input{Capitulo7/conclusions} 10 | %\input{Capitulo7/contributions} 11 | %\input{Capitulo7/future} 12 | %\input{Capitulo7/publications} 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /command_line/docker/chainer/dockerfile: -------------------------------------------------------------------------------- 1 | FROM nvidia/cuda:7.5-cudnn5-devel 2 | 3 | RUN apt-get update && apt-get install -y --no-install-recommends \ 4 | build-essential \ 5 | cmake \ 6 | git \ 7 | curl \ 8 | vim \ 9 | ca-certificates \ 10 | libjpeg-dev \ 11 | libpng-dev &&\ 12 | rm -rf /var/lib/apt/lists/* 13 | 14 | RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-4.2.12-Linux-x86_64.sh && \ 15 | chmod +x ~/miniconda.sh && \ 16 | ~/miniconda.sh -b -p /opt/conda && \ 17 | rm ~/miniconda.sh && \ 18 | /opt/conda/bin/conda install conda-build && \ 19 | /opt/conda/bin/conda create -y --name py35 python=3.5.2 numpy pyyaml scipy ipython mkl scikit-learn jupyter&& \ 20 | /opt/conda/bin/conda clean -ya 21 | ENV PATH /opt/conda/envs/py35/bin:$PATH 22 | 23 | RUN ["/bin/bash", "-c", "source activate py35 && pip install fire toolz cupy==2.0.0rc1 chainer==3.0.0rc1"] 24 | 25 | COPY ssh_config /root/.ssh/config 26 | RUN apt-get update && apt-get install -y --no-install-recommends \ 27 | openssh-client \ 28 | openssh-server \ 29 | iproute2 \ 30 | && apt-get clean \ 31 | && rm -rf /var/lib/apt/lists/* \ 32 | # configure ssh server and keys 33 | && mkdir /var/run/sshd \ 34 | && ssh-keygen -A \ 35 | && sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config \ 36 | && sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd \ 37 | && ssh-keygen -f /root/.ssh/id_rsa -t rsa -N '' \ 38 | && chmod 600 /root/.ssh/config \ 39 | && chmod 700 /root/.ssh \ 40 | && cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys 41 | 42 | 43 | EXPOSE 23 44 | CMD ["/usr/sbin/sshd", "-D", "-p", "23"] 45 | 46 | -------------------------------------------------------------------------------- /latex/thesis/Capitulo2/ch_basics.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | %2345678901234567890123456789012345678901234567890123456789012345678901234567890 3 | % 1 2 3 4 5 6 7 8 4 | \chapter{Basic Representations for Postural Control in Humanoids}\label{ch_basics} 5 | \textit{This chapter deals with some basic concepts that are repeatably used in this thesis. There are some basic tasks that have to be done in advance in order to conduct many of the experiments. They are related to modeling, kinematics, control and dynamics. There are many aspects of the humanoid set up that are not explicitly described in the thesis. This chapter acts as the basis of some of the algorithms that are explained in the next chapters. First, a study of different humanoid robot models is presented. It includes simple models to represent the robot, like the inverted pendulum, and complex models like the mass distributed model. The equation of motion of each of them is obtained. These models are included in some motion generation algorithms and balance maintenance methods. Afterwards, the most famous stability criterion, the Zero Moment Point (ZMP), is explained in detail. Furthermore, two common methods of biped locomotion generation are studied, the 3D Linear Inverted Pendulum Model and the Cart Table model. The latter was used to generate stable biped locomotion in the real humanoid. Finally, a simple method of whole body imitation is presented and a dance performance is obtained as an experiment. } 6 | \newpage 7 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 8 | %\input{Capitulo2/intro} 9 | %\input{Capitulo2/model} 10 | %\input{Capitulo2/generation} 11 | %\input{Capitulo2/dancing} 12 | %\input{Capitulo2/conclusions} 13 | -------------------------------------------------------------------------------- /command_line/docker/pytorch/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04 2 | 3 | RUN echo "deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list 4 | 5 | RUN apt-get update && apt-get install -y --allow-downgrades --no-install-recommends \ 6 | build-essential \ 7 | cmake \ 8 | git \ 9 | curl \ 10 | vim \ 11 | ca-certificates \ 12 | libnccl2=2.0.5-3+cuda9.0 \ 13 | libnccl-dev=2.0.5-3+cuda9.0 \ 14 | libjpeg-dev \ 15 | libpng-dev && \ 16 | rm -rf /var/lib/apt/lists/* 17 | 18 | 19 | ENV PYTHON_VERSION=3.6 20 | RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ 21 | chmod +x ~/miniconda.sh && \ 22 | ~/miniconda.sh -b -p /opt/conda && \ 23 | rm ~/miniconda.sh && \ 24 | # /opt/conda/bin/conda install conda-build && \ 25 | /opt/conda/bin/conda create -y --name pytorch-py$PYTHON_VERSION python=$PYTHON_VERSION numpy pyyaml scipy ipython jupyter ipykernel pandas matplotlib scikit-learn mkl&& \ 26 | /opt/conda/bin/conda clean -ya 27 | ENV PATH /opt/conda/envs/pytorch-py$PYTHON_VERSION/bin:$PATH 28 | #RUN conda install --name pytorch-py$PYTHON_VERSION -c soumith magma-cuda80 29 | # This must be done before pip so that requirements.txt is available 30 | WORKDIR /opt/pytorch 31 | COPY . . 32 | 33 | RUN git submodule update --init 34 | RUN TORCH_CUDA_ARCH_LIST="5.2 6.0 6.1 7.0+PTX" TORCH_NVCC_FLAGS="-Xfatbin -compress-all" \ 35 | CMAKE_PREFIX_PATH="$(dirname $(which conda))/../" \ 36 | pip install -v . 37 | 38 | RUN git clone https://github.com/pytorch/vision.git && cd vision && pip install -v . 39 | 40 | WORKDIR /workspace 41 | RUN chmod -R a+w /workspace 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /js/io_base/fs_io.js: -------------------------------------------------------------------------------- 1 | var fs = require("fs"); 2 | 3 | 4 | /** 5 | * Save an array to a file (separated by commas) 6 | * @param {Array} data - Array. 7 | * @param {String} filename - Name of the file. 8 | */ 9 | function saveFile(data, filename){ 10 | var dataStr = ''; 11 | for(i=0;i 6 |
7 | 8 | 9 | 12 | 15 | 16 | 17 | 20 | 23 | 24 | 25 | 28 | 31 | 32 | 33 | 36 | 39 | 40 | 41 | 44 | 47 | 48 | 49 | 52 | 53 |
10 | 11 | 13 | 14 |
18 | 19 | 21 | 22 |
26 | 27 | 29 | 30 |
34 | 35 | 37 | 38 |
42 | 43 | 45 | 46 |
50 | 51 |
54 |
-------------------------------------------------------------------------------- /latex/thesis/Capitulo5/ch_fraccional.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | %2345678901234567890123456789012345678901234567890123456789012345678901234567890 3 | % 1 2 3 4 5 6 7 8 4 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5 | \chapter{Robust Control of Humanoid Models through Fractional Calculus}\label{frac_chapter} 6 | \textit{There is an open discussion between those who defend mass distributed models for humanoid robots and those in favor of simple concentrated models. Even though each of them has its advantages and disadvantages, little research has been conducted analyzing the control performance due to the mismatch between the model and the real robot, and how the simplifications affect the controller’s output. In this chapter we address this problem by combining a reduced model of the humanoid robot, which has an easy mathematical formulation and implementation, with a fractional order controller, which is robust to changes in the model parameters. This controller is a generalization of the well-known PID structure obtained from the application of Fractional Calculus to control. This control strategy guarantees the robustness of the system, minimizing the effects from the assumption that the robot has a simple mass distribution. The humanoid robot is modeled and identified as a triple inverted pendulum and, using a gain scheduling strategy, the performances of a classical PID controller and a fractional order PID controller are compared, tuning the controller parameters with a genetic algorithm.} 7 | \newpage 8 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9 | %\input{Capitulo5/intro} 10 | %\input{Capitulo5/related_work} 11 | %\input{Capitulo5/fractional_controlers} 12 | %\input{Capitulo5/humanoid_robust_control} 13 | %\input{Capitulo5/results} 14 | %\input{Capitulo5/conclusions} 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /js/web/floating_balls/style.css: -------------------------------------------------------------------------------- 1 | /* Attribution: https://codepen.io/JonasBadalic/pen/cwEtH */ 2 | 3 | html,body { 4 | font-family: Raleway; 5 | overflow:hidden; 6 | width:100%; 7 | height:100%; 8 | position:absolute; 9 | background: linear-gradient(25deg,#16054A,#C8A6B4); 10 | text-shadow: 0px 1px 2px rgba(0,0,0,0.4); 11 | margin-top: 0px; 12 | margin-left: 0px; 13 | } 14 | .container { 15 | width:100%; 16 | height:100%; 17 | position:absolute; 18 | } 19 | #blurCanvasTop{ 20 | left:0%; 21 | top:0%; 22 | position:absolute; 23 | } 24 | #blurCanvasBottom{ 25 | left:50%; 26 | top:0; 27 | position:absolute; 28 | } 29 | .content { 30 | left:15%; 31 | top:20%; 32 | width:70%; 33 | position:relative; 34 | } 35 | h1.title { 36 | color:white; 37 | font-size: 4vw; 38 | display:inline; 39 | font-weight:500; 40 | } 41 | p.desc{ 42 | position:relative; 43 | width:100%; 44 | font-size:4vw; 45 | color:rgba(255,255,255,1); 46 | font-weight: 200; 47 | margin-bottom:40px; 48 | } 49 | .contacts { 50 | position:absolute; 51 | right:0%; 52 | bottom:0; 53 | margin-bottom:1vw; 54 | margin-right:1vw; 55 | } 56 | .contact li { 57 | list-style-type:none; 58 | float:left; 59 | color: rgba(255,255,255,0.8); 60 | font-weight:100; 61 | font-size:17px; 62 | } 63 | .contact li a { 64 | text-decoration:none; 65 | color: rgba(255,255,255,0.8); 66 | } 67 | .contact li a:hover{ 68 | color:rgba(255,255,255,1); 69 | } 70 | .contact li~li { 71 | margin-left:1vw; 72 | } 73 | .blur { 74 | width:100%; 75 | height:100%; 76 | position:absolute; 77 | overflow:hidden; 78 | } 79 | .blurTop{ 80 | left:40%; 81 | top:-110%; 82 | transform:rotate(20deg); 83 | transform-origin: 0 100%; 84 | } 85 | .blurBottom{ 86 | left:-60%; 87 | top:100%; 88 | transform:rotate(20deg); 89 | transform-origin: 100% 0%; 90 | } 91 | -------------------------------------------------------------------------------- /latex/thesis/Capitulo1/ch_intro.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | %2345678901234567890123456789012345678901234567890123456789012345678901234567890 3 | % 1 2 3 4 5 6 7 8 4 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5 | \chapter{Introduction} \label{ch_intro} 6 | \textit{This chapter deals with the initial introduction, motivation and presentation of this thesis. The thesis addresses aspects related to planning and control of complex postural tasks for humanoid robots using human learning by demonstration. The thesis proposes a specific situation that has to be solved by the robot. It is the order \robotorder that represents a complex task which involves the development of several skills and gives rise to a broad set of approaches to solve this problem. The present work is focused on discussing and studying methods that involves the generation and execution of humanoid motions in terms of postural body transitions. These postural body transitions are optimized using an index that we called the reward profile. The reward profile is a multi-modal time-dependent function that encodes the skill goal that the robot has to perform. At the same time, it is a measurement of the skill performance in terms of different aspects like stability, softness or human likeliness. Furthermore, this thesis addresses the modelling and control of the humanoid robot and presents a wide variety of simulated and experimental results. The objective behind this work is to make humanoid robots more intelligent and autonomous, by allowing them to follow complex orders safely and precisely.} 7 | \newpage 8 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9 | %\input{Capitulo1/motivation} 10 | %\input{Capitulo1/objectives} 11 | %\input{Capitulo1/organization} 12 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /js/web/star_background/code.js: -------------------------------------------------------------------------------- 1 | // Attribution: https://github.com/matteobruni/tsparticles 2 | 3 | tsParticles.load("tsparticles", { 4 | fpsLimit: 60, 5 | interactivity: { 6 | detect_on: "canvas", 7 | events: { 8 | onclick: { enable: true, mode: "repulse" }, 9 | onhover: { 10 | enable: true, 11 | mode: "bubble", 12 | parallax: { enable: false, force: 2, smooth: 10 } 13 | }, 14 | resize: true 15 | }, 16 | modes: { 17 | bubble: { distance: 200, duration: 2, opacity: 0, size: 0, speed: 3 }, 18 | grab: { distance: 400, line_linked: { opacity: 1 } }, 19 | push: { particles_nb: 4 }, 20 | remove: { particles_nb: 2 }, 21 | repulse: { distance: 400, duration: 0.4 } 22 | } 23 | }, 24 | particles: { 25 | color: { value: "#ffffff" }, 26 | line_linked: { 27 | color: "#ffffff", 28 | distance: 150, 29 | enable: false, 30 | opacity: 0.4, 31 | width: 1 32 | }, 33 | move: { 34 | attract: { enable: false, rotateX: 600, rotateY: 600 }, 35 | bounce: false, 36 | direction: "none", 37 | enable: true, 38 | out_mode: "out", 39 | random: true, 40 | speed: 0.3, 41 | straight: false 42 | }, 43 | number: { density: { enable: true, value_area: 800 }, value: 600 }, 44 | opacity: { 45 | anim: { enable: true, opacity_min: 0.3, speed: 5, sync: false }, 46 | random: { 47 | enable: true, 48 | minimumValue: 0.3 49 | }, 50 | value: 0.6 51 | }, 52 | shape: { 53 | type: "circle" 54 | }, 55 | size: { 56 | anim: { enable: false, size_min: 0.3, speed: 4, sync: false }, 57 | random: false, 58 | value: 1 59 | } 60 | }, 61 | retina_detect: true 62 | }); 63 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # C++ 10 | CMakeLists.txt.user 11 | *.exe 12 | *.ilk 13 | *.pdb 14 | 15 | # Distribution / packaging 16 | .Python 17 | env/ 18 | build/ 19 | develop-eggs/ 20 | dist/ 21 | downloads/ 22 | eggs/ 23 | .eggs/ 24 | lib/ 25 | lib64/ 26 | parts/ 27 | sdist/ 28 | var/ 29 | *.egg-info/ 30 | .installed.cfg 31 | *.egg 32 | 33 | # PyInstaller 34 | # Usually these files are written by a python script from a template 35 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 36 | *.manifest 37 | *.spec 38 | 39 | # Installer logs 40 | pip-log.txt 41 | pip-delete-this-directory.txt 42 | 43 | # Unit test / coverage reports 44 | htmlcov/ 45 | .tox/ 46 | .coverage 47 | .coverage.* 48 | .cache 49 | nosetests.xml 50 | coverage.xml 51 | *,cover 52 | .hypothesis/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | 62 | # Flask stuff: 63 | instance/ 64 | .webassets-cache 65 | 66 | # Scrapy stuff: 67 | .scrapy 68 | 69 | # Sphinx documentation 70 | docs/_build/ 71 | 72 | # PyBuilder 73 | target/ 74 | 75 | # IPython Notebook 76 | .ipynb_checkpoints 77 | 78 | # pyenv 79 | .python-version 80 | 81 | # celery beat schedule file 82 | celerybeat-schedule 83 | 84 | # dotenv 85 | .env 86 | 87 | # virtualenv 88 | venv/ 89 | ENV/ 90 | 91 | # Spyder project settings 92 | .spyderproject 93 | 94 | # Rope project settings 95 | .ropeproject 96 | 97 | 98 | ###### 99 | .DS_Store 100 | *~ 101 | */url_base/license.txt 102 | Untitled.ipynb 103 | *-Copy*.ipynb 104 | .pytest_cache/ 105 | mig.png 106 | .vscode/ 107 | share/blob_config.json 108 | test-reports/ 109 | *.sqlite3 110 | *.db 111 | test.mp4 112 | python/test/output.ipynb 113 | file.* 114 | output.ipynb 115 | license.txt 116 | *.aux 117 | *.pdf 118 | *.out 119 | *.bbl 120 | *.blg 121 | *.lof 122 | *.loa 123 | *.loc 124 | *.toc 125 | *.lot 126 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /latex/thesis/Capitulo6/ch_postural_control.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | %2345678901234567890123456789012345678901234567890123456789012345678901234567890 3 | % 1 2 3 4 5 6 7 8 4 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5 | %\chapter{Postural Planning and Control in Complex Environments}\label{ch_postural_control} 6 | \chapter{Control of Humanoid Robots Executing Complex Tasks}\label{ch_postural_control} 7 | \textit{This chapter deals with the planning and execution of a complex task ordered to a humanoid robot. The robot has to be able to execute high level postural tasks in the presence of a cluttered environment. The motion execution must be soft and stable and, at the same time, the robot has to be able to successfully avoid obstacles in the environment. First, the robot has to identify the environment and the obstacles. Second, the robot has to be able to move from the initial point to the final point performing a set of postural movements. The postural task is performed in two levels, a postural planning, which off-line computes the safe and stable postural movement that allows the robot to navigate through the environment, and an online postural control, which has to do with the execution, control and disturbance rejection that makes possible the fulfillment of the task. This chapter encompasses the learning strategies explained in chapters \ref{ch_imitation} and \ref{ch_multiple_behaviors}, the control method of chapter \ref{frac_chapter}, while using methodologies of chapter \ref{ch_basics}. The task selected as an example is a robot that starts seated on a chair, stands up, walks avoiding obstacles until it reaches a door, opens the door and leaves the room. This chapter also gives a practical significance to this thesis. } 8 | \newpage 9 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10 | 11 | %\input{Capitulo6/intro} 12 | %\input{Capitulo6/environment} 13 | %\input{Capitulo6/postural_planning} 14 | %\input{Capitulo6/postural_control} 15 | %\input{Capitulo6/results} 16 | %\input{Capitulo6/conclusions} 17 | -------------------------------------------------------------------------------- /js/web/star_wars/wars.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /latex/thesis/Capitulo4/ch_multiple_behaviors.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | %2345678901234567890123456789012345678901234567890123456789012345678901234567890 3 | % 1 2 3 4 5 6 7 8 4 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5 | \chapter{Learning and Improving a Sequence of Goal Directed Skills}\label{ch_multiple_behaviors} 6 | \textit{As it was discussed in the previous chapter, there are evidences that justify that the imitation between humans are goal-directed. We proposed there a new method to acquire a single skill from human demonstrations. However, it is quite common for a human being to perform several skills sequentially, for example, to walk to a door and open it. Therefore, when performing multiple skills, we internally define an unknown optimal policy to satisfy multiple goals. This chapter presents a method to transfer a complex behavior composed by multiple skills from a human demonstrator to a humanoid robot. We defined a multi-objective reward function as a measurement of the goal optimality for both human and robot, which is defined in each subtask of the global behavior. We optimized a hierarchical policy to generate whole-body movements for the robot that produces a reward profile that is compared and matched with the human reward profile, producing an imitative behavior. Furthermore, we can search in the proximity of the solution space to improve the reward profile and innovate a new solution, which is more beneficial for the humanoid. Experiments were carried out in a real humanoid robot.} 7 | \newpage 8 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9 | % chapter1 10 | %\input{Capitulo4/intro} 11 | %\input{Capitulo4/related_work} 12 | %\input{Capitulo4/open_door} 13 | %chapter2 14 | %\input{Capitulo4/policy} 15 | %\input{Capitulo4/gmm_gmr} 16 | %\input{Capitulo4/primitives} 17 | %\input{Capitulo4/policy_optimization} 18 | %chapter3 19 | %\input{Capitulo4/demonstrations} 20 | %\input{Capitulo4/behavior_selector} 21 | %\input{Capitulo4/reward} 22 | %\input{Capitulo4/trajectory_generation} 23 | %chapter4 24 | %\input{Capitulo4/conclusions} 25 | -------------------------------------------------------------------------------- /js/web/star_wars/star.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /matlab/image_base/gistdescriptor/showGist.m: -------------------------------------------------------------------------------- 1 | function showGist(gist, param) 2 | % 3 | % Visualization of the gist descriptor 4 | % showGist(gist, param) 5 | % 6 | % The plot is color coded, with one color per scale 7 | % 8 | % Example: 9 | % img = zeros(256,256); 10 | % img(64:128,64:128) = 255; 11 | % gist = LMgist(img, '', param); 12 | % showGist(gist, param) 13 | 14 | 15 | [Nimages, Ndim] = size(gist); 16 | nx = ceil(sqrt(Nimages)); ny = ceil(Nimages/nx); 17 | 18 | Nblocks = param.numberBlocks; 19 | Nfilters = sum(param.orientationsPerScale); 20 | Nscales = length(param.orientationsPerScale); 21 | 22 | C = hsv(Nscales); 23 | colors = []; 24 | for s = 1:Nscales 25 | colors = [colors; repmat(C(s,:), [param.orientationsPerScale(s) 1])]; 26 | end 27 | colors = colors'; 28 | 29 | [nrows ncols Nfilters] = size(param.G); 30 | Nfeatures = Nblocks^2*Nfilters; 31 | 32 | if Ndim~=Nfeatures 33 | error('Missmatch between gist descriptors and the parameters'); 34 | end 35 | 36 | G = param.G(1:2:end,1:2:end,:); 37 | [nrows ncols Nfilters] = size(G); 38 | G = G + flipdim(flipdim(G,1),2); 39 | G = reshape(G, [ncols*nrows Nfilters]); 40 | 41 | 42 | if Nimages>1 43 | figure; 44 | end 45 | 46 | for j = 1:Nimages 47 | g = reshape(gist(j,:), [Nblocks Nblocks Nfilters]); 48 | g = permute(g,[2 1 3]); 49 | g = reshape(g, [Nblocks*Nblocks Nfilters]); 50 | 51 | for c = 1:3 52 | mosaic(:,c,:) = G*(repmat(colors(c,:), [Nblocks^2 1]).*g)'; 53 | end 54 | mosaic = reshape(mosaic, [nrows ncols 3 Nblocks*Nblocks]); 55 | mosaic = fftshift(fftshift(mosaic,1),2); 56 | mosaic = uint8(mosaic/max(mosaic(:))*255); 57 | mosaic(1,:,:,:) = 255; 58 | mosaic(end,:,:,:) = 255; 59 | mosaic(:,1,:,:) = 255; 60 | mosaic(:,end,:,:) = 255; 61 | 62 | if Nimages>1 63 | subplottight(ny,nx,j,0.01); 64 | end 65 | montage(mosaic, 'size', [Nblocks Nblocks]) 66 | end 67 | 68 | 69 | function h=subplottight(Ny, Nx, j, margin) 70 | % General utility function 71 | % 72 | % This function is like subplot but it removes the spacing between axes. 73 | % 74 | % subplottight(Ny, Nx, j) 75 | 76 | if nargin <4 77 | margin = 0; 78 | end 79 | 80 | j = j-1; 81 | x = mod(j,Nx)/Nx; 82 | y = (Ny-fix(j/Nx)-1)/Ny; 83 | h=axes('position', [x+margin/Nx y+margin/Ny 1/Nx-2*margin/Nx 1/Ny-2*margin/Ny]); 84 | 85 | -------------------------------------------------------------------------------- /latex/thesis/additional/chapter_abstract.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | %2345678901234567890123456789012345678901234567890123456789012345678901234567890 3 | % 1 2 3 4 5 6 7 8 4 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5 | This thesis addresses the problem of planning and controlling complex tasks in a humanoid robot from a postural point of view. It is motivated by the growth of robotics in our current society, where simple robots are being integrated. Its objective is to make an advancement in the development of complex behaviors in humanoid robots, in order to allow them to share our environment in the future. 6 | 7 | The work presents different contributions in the areas of humanoid robot postural control, behavior planning, non-linear control, learning from demonstration and reinforcement learning. First, as an introduction of the thesis, a group of methods and mathematical formulations are presented, describing concepts such as humanoid robot modelling, generation of locomotion trajectories and generation of whole-body trajectories. 8 | 9 | Next, the process of human learning is studied in order to develop a novel method of postural task transference between a human and a robot. It uses the demonstrated action goal as a metrics of comparison, which is codified using the reward associated to the task execution. 10 | 11 | As an evolution of the previous study, this process is generalized to a set of sequential behaviors, which are executed by the robot based on human demonstrations. 12 | 13 | Afterwards, the execution of postural movements using a robust control approach is proposed. This method allows to control the desired trajectory even with mismatches in the robot model. 14 | 15 | Finally, an architecture that encompasses all methods of postural planning and control is presented. It is complemented by an environment recognition module that identifies the free space in order to perform path planning and generate safe movements for the robot. 16 | 17 | The experimental justification of this thesis was developed using the humanoid robot HOAP-3. Tasks such as walking, standing up from a chair, dancing or opening a door have been implemented using the techniques proposed in this work. 18 | 19 | 20 | -------------------------------------------------------------------------------- /gs/RutinaMacros.gs: -------------------------------------------------------------------------------- 1 | // To enable this function, I need to create a trigger. Go to Triggers, Add Trigger. Then select the following options: 2 | // Choose which function to run: onSelectionChange 3 | // Select event source: From spreadsheet 4 | // Select event type: On edit 5 | function onSelectionChange(e) { 6 | //Logger.log(JSON.stringify(e)); 7 | const as = e.source.getActiveSheet(); 8 | const col = e.range.getColumn(); 9 | // Automatically execute when there is a change in sheet Miguel and column G 10 | if (as.getName() == 'Miguel' && col === 7){ 11 | rutinaMacros(); 12 | } 13 | } 14 | 15 | function rutinaMacros() { 16 | var ss = SpreadsheetApp.getActiveSpreadsheet(); 17 | var sheet = ss.getSheetByName("Miguel"); 18 | var range = sheet.getRange("G156:G250"); 19 | var numRows = range.getNumRows(); 20 | 21 | for (i=1; i<=numRows; i++){ 22 | var cell = range.getCell(i,1); //only one column 23 | Logger.log("Ejecutando celda: %s", cell.getA1Notation()) 24 | 25 | if (!cell.isBlank()){ 26 | var formula = cell.getFormula(); 27 | 28 | // Proteinas 29 | var cellProteinas = range.offset(0, 1).getCell(i,1); 30 | if (cellProteinas.isBlank()){ 31 | var formulaProteinas = formula.replace(/Meals!B/g, "Meals!J").replace(/Foods!C/g, "Foods!K"); 32 | //Logger.log(formulaProteinas) 33 | Logger.log("Computando proteínas en celda %s", cellProteinas.getA1Notation()); 34 | cellProteinas.setFormula(formulaProteinas); 35 | 36 | } 37 | 38 | // Grasas 39 | var cellGrasas = range.offset(0, 2).getCell(i,1); 40 | if (cellGrasas.isBlank()){ 41 | var formulaGrasas = formula.replace(/Meals!B/g, "Meals!D").replace(/Foods!C/g, "Foods!E"); 42 | //Logger.log(formulaGrasas) 43 | Logger.log("Computando grasas en celda %s", cellGrasas.getA1Notation()); 44 | cellGrasas.setFormula(formulaGrasas); 45 | } 46 | 47 | // Hidratos 48 | var cellCH = range.offset(0, 3).getCell(i,1); 49 | if (cellCH.isBlank()){ 50 | var formulaCH = formula.replace(/Meals!B/g, "Meals!E").replace(/Foods!C/g, "Foods!F"); 51 | //Logger.log(formulaGrasas) 52 | Logger.log("Computando hidratos en celda %s", cellCH.getA1Notation()); 53 | cellCH.setFormula(formulaCH); 54 | } 55 | } 56 | } 57 | Logger.log("Rutina finalizada") 58 | 59 | } 60 | -------------------------------------------------------------------------------- /command_line/docker/keras/dockerfile: -------------------------------------------------------------------------------- 1 | FROM nvidia/cuda:8.0-cudnn6-devel 2 | 3 | # Based on dockerfile from https://github.com/fchollet/keras/tree/master/docker 4 | 5 | # SSH for BAIT 6 | COPY ssh_config /root/.ssh/config 7 | RUN apt-get update && apt-get install -y --no-install-recommends \ 8 | openssh-client \ 9 | openssh-server \ 10 | iproute2 \ 11 | && apt-get clean \ 12 | && rm -rf /var/lib/apt/lists/* \ 13 | # configure ssh server and keys 14 | && mkdir /var/run/sshd \ 15 | && ssh-keygen -A \ 16 | && sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config \ 17 | && sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd \ 18 | && ssh-keygen -f /root/.ssh/id_rsa -t rsa -N '' \ 19 | && chmod 600 /root/.ssh/config \ 20 | && chmod 700 /root/.ssh \ 21 | && cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys 22 | 23 | 24 | ENV CONDA_DIR /opt/conda 25 | ENV PATH $CONDA_DIR/bin:$PATH 26 | 27 | RUN mkdir -p $CONDA_DIR && \ 28 | echo export PATH=$CONDA_DIR/bin:'$PATH' > /etc/profile.d/conda.sh && \ 29 | apt-get update && \ 30 | apt-get install -y wget git libhdf5-dev g++ graphviz openmpi-bin && \ 31 | wget --quiet https://repo.continuum.io/miniconda/Miniconda3-4.2.12-Linux-x86_64.sh && \ 32 | echo "c59b3dd3cad550ac7596e0d599b91e75d88826db132e4146030ef471bb434e9a *Miniconda3-4.2.12-Linux-x86_64.sh" | sha256sum -c - && \ 33 | /bin/bash /Miniconda3-4.2.12-Linux-x86_64.sh -f -b -p $CONDA_DIR && \ 34 | rm Miniconda3-4.2.12-Linux-x86_64.sh 35 | 36 | 37 | RUN mkdir -p $CONDA_DIR && \ 38 | mkdir -p /src 39 | 40 | 41 | # Python 42 | ARG python_version=3.5 43 | 44 | RUN conda install -y python=${python_version} && \ 45 | pip install --upgrade pip && \ 46 | pip install tensorflow-gpu && \ 47 | pip install https://cntk.ai/PythonWheel/GPU/cntk-2.1-cp35-cp35m-linux_x86_64.whl && \ 48 | conda install Pillow scikit-learn notebook pandas matplotlib mkl nose pyyaml six h5py && \ 49 | conda install pygpu bcolz && \ 50 | pip install sklearn_pandas fire toolz && \ 51 | git clone git://github.com/fchollet/keras.git /src && pip install -e /src[tests] && \ 52 | pip install git+git://github.com/fchollet/keras.git && \ 53 | conda clean -yt 54 | 55 | ENV PYTHONPATH='/src/:$PYTHONPATH' 56 | 57 | WORKDIR /src 58 | 59 | EXPOSE 23 60 | CMD ["/usr/sbin/sshd", "-D", "-p", "23"] 61 | -------------------------------------------------------------------------------- /latex/thesis/Capitulo3/ch_imitation.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | %2345678901234567890123456789012345678901234567890123456789012345678901234567890 3 | % 1 2 3 4 5 6 7 8 4 | \chapter{Imitation Learning and Skill Innovation in Humanoids through Reward Templates}\label{ch_imitation} 5 | \textit{The imitation of a skill and its improvement by innovating new solutions are the key steps to human learning. The process of human learning has been widely studied in psychology, sociology and neuroscience. Terms such as emulation or imitation are common in these sciences and widely discussed. The behavior transference from a human to a robot is the content of this chapter. Standing up from a chair to a stable upright posture causes conventional Zero Moment Point (ZMP) based controllers of humanoid robots to produce excessive joint torques. Humans, however, are known to manage this challenging dynamic posture control task very elegantly. This chapter proposes a novel method for humanoid robots to acquire optimal standing up behaviors based on human demonstrations. We collected 3D motion data of a group of human subjects standing up from a chair. We solve the correspondence problem by making comparisons in a common reward space defined by a multi-objective reward function. We fitted a fully actuated triple inverted pendulum model to both human and robot motion data in order to compute a reward profile for stability and effort. Afterwards, we used Differential Evolution optimizer to obtain a trajectory that minimizes the Kullback-Liebler divergence between the reward of the human and that of the robot, subject to constraints of ZMP, joint torques, and joint rotation limits of the robot. 6 | This chapter presents an advancement in how a humanoid robot can learn to imitate and innovate motor skills from demonstrations of human teachers of larger kinematic structures and different actuator constraints. %We present analytical and experimental results for the task of standing up from a chair to a stable upright posture, where the robot has to transit from one stable posture to another via a set of unstable states. 7 | } 8 | \newpage 9 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10 | %\input{Capitulo3/intro} 11 | %\input{Capitulo3/imitation_learning} 12 | %\input{Capitulo3/innovation_learning} 13 | %\input{Capitulo3/model} 14 | %\input{Capitulo3/results} 15 | %\input{Capitulo3/conclusions} 16 | -------------------------------------------------------------------------------- /latex/thesis/additional/chapter_resumen.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | %2345678901234567890123456789012345678901234567890123456789012345678901234567890 3 | % 1 2 3 4 5 6 7 8 4 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5 | %\vspace{-2cm} 6 | Esta tesis aborda el problema de la planificación y control de tareas complejas de un robot humanoide desde el punto de vista postural. Viene motivada por el auge de la robótica en la sociedad actual, donde ya se están incorporando robots sencillos y su objetivo es avanzar en el desarrollo de comportamientos complejos en robots humanoides, para que en el futuro sean capaces de compartir nuestro entorno. 7 | 8 | El trabajo presenta diferentes contribuciones en las áreas de control postural de robots humanoides, planificación de comportamientos, control no lineal, aprendizaje por demostración y aprendizaje por refuerzo. En primer lugar se desarrollan un conjunto de métodos y formulaciones matemáticas sobre los que se sustenta la tesis, describiendo conceptos de modelado de robots humanoides, generación de trayectorias de locomoción y generación de trayectorias del cuerpo completo. 9 | 10 | A continuación se estudia el proceso de aprendizaje humano, para desarrollar un novedoso método de transferencia de una tarea postural de un humano a un robot, usando como métrica de comparación el objetivo de la acción demostrada, que es codificada a través del refuerzo asociado a la ejecución de dicha tarea. 11 | 12 | Como evolución del trabajo anterior, se generaliza este proceso para la realización de un conjunto de comportamientos secuenciales, que son de nuevo realizados por el robot basándose en las demostraciones de un ser humano. 13 | 14 | Seguidamente se estudia la ejecución de movimientos posturales utilizando un método de control robusto ante imprecisiones en el modelado del robot. 15 | 16 | Para finalizar, se presenta una arquitectura que aglutina los métodos de planificación y el control postural desarrollados en los capítulos anteriores. Esto se complementa con un módulo de reconocimiento del entorno y extracción del espacio libre para poder planificar y generar movimientos seguros en dicho entorno. 17 | 18 | La justificación experimental de la tesis se ha desarrollado con el robot humanoide HOAP-3. En este robot se han implementado tareas como caminar, levantarse de una silla, bailar o abrir una puerta. Todo ello haciendo uso de las técnicas propuestas en este trabajo. 19 | 20 | 21 | % 22 | 23 | 24 | -------------------------------------------------------------------------------- /command_line/docker/pytorch/README.md: -------------------------------------------------------------------------------- 1 | # Docker for PyTorch 2 | 3 | This document explains how to install a docker image in Ubuntu 16.04 with PyTorch, CUDA9 and CUDNN7 in an Azure DSVM. 4 | 5 | ## Uninstall all NVIDIA dependencies in your VM (optional) 6 | Uninstall all NVIDIA dependencies 7 | 8 | sudo apt-get remove --purge nvidia-* 9 | sudo apt-get remove --purge bbswitch-dkms libcupti-dev:amd64 libcupti-doc libcupti7.5:amd64 10 | 11 | ## Download and install CUDA9 12 | 13 | Download [CUDA9](https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal) and install it. 14 | 15 | wget https://developer.nvidia.com/compute/cuda/9.1/Prod/local_installers/cuda-repo-ubuntu1604-9-1-local_9.1.85-1_amd64 16 | sudo dpkg -i cuda-repo-ubuntu1604-9-1-local_9.1.85-1_amd64 17 | sudo apt-key add /var/cuda-repo-9-1-local/7fa2af80.pub 18 | sudo apt-get update 19 | sudo apt-get install cuda 20 | 21 | ## Install nvidia-docker 22 | 23 | curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \ 24 | sudo apt-key add - 25 | curl -s -L https://nvidia.github.io/nvidia-docker/ubuntu16.04/amd64/nvidia-docker.list | \ 26 | sudo tee /etc/apt/sources.list.d/nvidia-docker.list 27 | sudo apt-get update 28 | sudo apt-get install nvidia-docker 29 | 30 | # Clone PyTorch 31 | 32 | git clone https://github.com/pytorch/pytorch 33 | 34 | ## Replace the new Dockerfile in this repo with the one available in PyTorch root folder 35 | 36 | cp Dockerfile /path/to/pytorch 37 | 38 | ## Build the Docker image 39 | 40 | cd /path/to/pytorch 41 | sudo docker build -t pytorchcuda9 . 42 | 43 | ## Run the image 44 | 45 | You can list your docker images by typing: 46 | 47 | sudo docker images 48 | 49 | There are several options to run the image. Standard run: 50 | 51 | sudo nvidia-docker run -it pytorchcuda9 bash 52 | 53 | Run the image and map your local home to the docker filesystem: 54 | 55 | sudo nvidia-docker run -v $HOME:/mnt/home -it pytorchcuda9 bash 56 | 57 | Run the image and open a port to access jupyter: 58 | 59 | sudo nvidia-docker run -p 8888:8888 -v $HOME:/mnt/home -it pytorchcuda9 bash 60 | 61 | ## Make sure that everything works correctly 62 | 63 | Once inside the docker image: 64 | 65 | python 66 | >>> import torch 67 | >>> print(torch.__version__) 68 | 0.4.0a0+0bc1505 69 | >>> print(torch.backends.cudnn.version()) 70 | 7005 71 | >>> print(torch.cuda.device_count()) 72 | 4 73 | 74 | Enjoy! 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /command_line/docker/README.md: -------------------------------------------------------------------------------- 1 | # Docker basic commands 2 | 3 | List of Docker basic commands. More info can be found [here](https://docs.docker.com/engine/reference/commandline/docker/). 4 | 5 | ```bash 6 | sudo docker build -t my_image_name . -> Build the image my_image_name using the Dockerfile of the current location 7 | sudo docker run -it my_image_name bash -> Run the docker image and enter the bash 8 | sudo nvidia-docker run -it my_image_name bash -> Run the docker image and enter the bash with NVIDIA drivers support 9 | sudo docker run -p 8888:8888 -it my_image_name bash -> Run the image redirecting a port (useful for jupyter support) 10 | sudo docker run -p 8888:8888 -v $HOME:/mnt/home -it my_image_name bash -> Run the image redirecting a port and making your local home accessible 11 | sudo docker images -> list the images available 12 | docker images -f dangling=true -> list dangling images (those with no relationship to any tagged images) 13 | sudo docker ps -> list the images currently running 14 | sudo docker stop my_image_id -> Stop the image using its ID (the ID can be found with docker ps) 15 | sudo docker stop $(docker ps -q --filter ancestor=my_image_name ) -> Stop the image by its name 16 | sudo docker rmi my_image_name -> remove an image 17 | sudo docker images purge -> remove all dangling images 18 | sudo docker system prune -a -> remove all stopped containers and unused images 19 | ``` 20 | ## Upload image to DockerHub 21 | 22 | ```bash 23 | sudo docker login --username=hoaphumanoid 24 | sudo docker images 25 | ``` 26 | You will get a list of your images: 27 | 28 | ```bash 29 | REPOSITORY TAG IMAGE ID CREATED SIZE 30 | cuda_ubuntu_base latest f161297fd883 9 minutes ago 4.22GB 31 | nvidia/cuda 8.0-cudnn7-devel-ubuntu16.04 0c17239b6723 13 days ago 2.09GB 32 | azureml_25f82d93633330a2a06f0a73fb43bb0a latest fd02e6d814fa 8 weeks ago 7.04GB 33 | azureml_d03b8bc55f6f6aae78794809bd9c4cdd latest 4f95489c8626 2 months ago 3.8GB 34 | microsoft/mmlspark plus-0.9.9 7d6dc0293c47 6 months ago 1.58GB 35 | ``` 36 | 37 | Now you can tag your image: 38 | 39 | ```bash 40 | sudo docker tag f161297fd883 hoaphumanoid/cuda_ubuntu_base:cuda8-cudnn7-ubuntu16.04 41 | ``` 42 | 43 | Then push your image to the repository you created: 44 | 45 | ```bash 46 | sudo docker push hoaphumanoid/cuda_ubuntu_base 47 | ``` 48 | 49 | You can also pull an image from DockerHub, using name and tag: 50 | 51 | ```bash 52 | sudo docker pull hoaphumanoid/cuda_ubuntu_base:cuda8-cudnn7-ubuntu16.04 53 | ``` 54 | 55 | 56 | -------------------------------------------------------------------------------- /sql/mysql/README.md: -------------------------------------------------------------------------------- 1 | # MySQL 2 | 3 | 4 | ## Installation 5 | 6 | To install MySQL and MySQL support for PHP: 7 | 8 | ```bash 9 | sudo apt install mysql-server php-mysql 10 | ``` 11 | 12 | After installing MySQL execute the following command for initial settings of MySQL server. You will see that script will prompt for more settings than earlier MySQL versions like password validation policy etc. 13 | 14 | ```bash 15 | sudo mysql_secure_installation 16 | ``` 17 | 18 | The prompt drives you through these options: 19 | 20 | ```bash 21 | Securing the MySQL server deployment. 22 | 23 | Connecting to MySQL using a blank password. 24 | 25 | VALIDATE PASSWORD COMPONENT can be used to test passwords 26 | and improve security. It checks the strength of password 27 | and allows the users to set only those passwords which are 28 | secure enough. Would you like to setup VALIDATE PASSWORD component? 29 | 30 | Press y|Y for Yes, any other key for No: y 31 | 32 | There are three levels of password validation policy: 33 | 34 | LOW Length >= 8 35 | MEDIUM Length >= 8, numeric, mixed case, and special characters 36 | STRONG Length >= 8, numeric, mixed case, special characters and dictionary file 37 | 38 | Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2 39 | Please set the password for root here. 40 | 41 | New password: 42 | 43 | Re-enter new password: 44 | 45 | Estimated strength of the password: 100 46 | Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y 47 | By default, a MySQL installation has an anonymous user, 48 | allowing anyone to log into MySQL without having to have 49 | a user account created for them. This is intended only for 50 | testing, and to make the installation go a bit smoother. 51 | You should remove them before moving into a production 52 | environment. 53 | 54 | Remove anonymous users? (Press y|Y for Yes, any other key for No) : y 55 | Success. 56 | 57 | 58 | Normally, root should only be allowed to connect from 59 | 'localhost'. This ensures that someone cannot guess at 60 | the root password from the network. 61 | 62 | Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y 63 | Success. 64 | 65 | By default, MySQL comes with a database named 'test' that 66 | anyone can access. This is also intended only for testing, 67 | and should be removed before moving into a production 68 | environment. 69 | 70 | 71 | Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y 72 | - Dropping test database... 73 | Success. 74 | 75 | - Removing privileges on test database... 76 | Success. 77 | 78 | Reloading the privilege tables will ensure that all changes 79 | made so far will take effect immediately. 80 | 81 | Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y 82 | Success. 83 | 84 | All done! 85 | ``` 86 | 87 | ## Log in MySQL 88 | 89 | ```bash 90 | mysql -u root -p 91 | ``` 92 | 93 | ## Managing MySQL 94 | 95 | For creating a user, see [create_user.sql](create_user.sql). 96 | 97 | -------------------------------------------------------------------------------- /js/web/shuffle_words/chaffle.min.js: -------------------------------------------------------------------------------- 1 | !function (t, e) { "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? module.exports = e() : t.Chaffle = e() }(this, function () { "use strict"; function t(t, e) { var r = {}, n = t.getAttribute("data-chaffle"), a = t.getAttribute("data-chaffle-speed"), o = t.getAttribute("data-chaffle-delay"); 0 !== n.length && (r.lang = n), null !== a && (r.speed = Number(a)), null !== o && (r.delay = Number(o)), this.options = { lang: "en", speed: 20, delay: 100 }, this.options = function t() { var e = {}, r = !1; function n(n) { for (var a in n) Object.prototype.hasOwnProperty.call(n, a) && (r && "[object Object]" === Object.prototype.toString.call(n[a]) ? e[a] = t(!0, e[a], n[a]) : e[a] = n[a]) } "[object Boolean]" === Object.prototype.toString.call(arguments[0]) && (r = arguments[0], a++); for (var a = 0; a < arguments.length; a++)n(arguments[a]); return e }(this.options, e, r), this.element = t, this.text = this.element.textContent, this.substitution = "", this.state = !1, this.shuffleProps = [], this.reinstateProps = [] } return t.prototype = { constructor: t, init: function () { var t = this; if (!t.state) { t.clearShuffleTimer(), t.clearReinstateTimer(), t.state = !0, t.substitution = "", t.shuffleProps = [], t.reinstateProps = []; var e = setInterval(function () { t.shuffle() }, t.options.speed), r = setInterval(function () { t.reinstate() }, t.options.delay); t.shuffleProps = e, t.reinstateProps = r } }, shuffle: function () { this.element.textContent = this.substitution; var t = this.text.length, e = this.substitution.length; if (t - e > 0) for (var r = 0; r <= t - e; r++)this.element.textContent = this.element.textContent + this.randomStr(); else this.clearShuffleTimer() }, reinstate: function () { var t = this.text.length, e = this.substitution.length; e < t ? this.element.textContent = this.substitution = this.text.substr(0, e + 1) : this.clearReinstateTimer(), this.state = !1 }, clearShuffleTimer: function () { return clearInterval(this.shuffleProps) }, clearReinstateTimer: function () { return clearInterval(this.reinstateProps) }, randomStr: function () { var t; switch (this.options.lang) { case "en": t = String.fromCharCode(33 + Math.round(99 * Math.random())); break; case "en-lowercase": t = String.fromCharCode(97 + Math.round(25 * Math.random())); break; case "en-uppercase": t = String.fromCharCode(65 + Math.round(25 * Math.random())); break; case "en-letters": letters = [String.fromCharCode(65 + Math.round(25 * Math.random())), String.fromCharCode(97 + Math.round(25 * Math.random()))], t = letters[Math.floor(Math.random() * letters.length)]; break; case "ja": t = String.fromCharCode(19968 + Math.round(80 * Math.random())); break; case "ja-hiragana": t = String.fromCharCode(12353 + Math.round(85 * Math.random())); break; case "ja-katakana": t = String.fromCharCode(12449 + Math.round(85 * Math.random())); break; case "ua": t = String.fromCharCode(1040 + Math.round(55 * Math.random())); break; case "cn": t = String.fromCharCode(19968 + Math.floor(20901 * Math.random())) }return t } }, t }); -------------------------------------------------------------------------------- /matlab/plot_base/show_q.m: -------------------------------------------------------------------------------- 1 | function show_q (Ts, T, q_right_leg_rad, q_left_leg_rad, q_right_arm_rad, q_left_arm_rad) 2 | % 3 | % This function shows the join trajectory of arms and legs of a humanoid robot. 4 | % It has the join limits of the humanoid robot HOAP-3. 5 | % 6 | %time vector 7 | time=0:Ts:T-Ts; 8 | 9 | % Check if t is a row or a column vector 10 | n_elements = length(time); 11 | if (length(q_right_leg_rad) ~= n_elements) 12 | error('Trajectory and time must have the same lenght'); 13 | end 14 | q_right_leg_rad = trajectoriesToColumns(q_right_leg_rad); 15 | q_left_leg_rad = trajectoriesToColumns(q_left_leg_rad); 16 | q_right_arm_rad = trajectoriesToColumns(q_right_arm_rad); 17 | q_left_arm_rad = trajectoriesToColumns(q_left_arm_rad); 18 | 19 | %links positions range 20 | q_right_m = [-91; -31; -71; -1; -61; -25]; 21 | q_right_M = [31; 21; 82; 130; 61; 25]; 22 | q_left_m = [-31; -21; -82; -130; -61; -25]; 23 | q_left_M = [91; 31; 71; 1; 61; 25]; 24 | range_q_right = [q_right_m, q_right_M]; 25 | range_q_left = [q_left_m, q_left_M]; 26 | 27 | q_right_leg = 180/pi.*q_right_leg_rad; 28 | q_left_leg = 180/pi.*q_left_leg_rad; 29 | q_right_arm = 180/pi.*q_right_arm_rad; 30 | q_left_arm = 180/pi.*q_left_arm_rad; 31 | 32 | %right leg links positions plot 33 | figure('Name','Right leg links positions','NumberTitle','off') 34 | for ii=1:6 35 | subplot(2,3,ii); 36 | hold on 37 | plot(time,q_right_leg(:,ii),'b'); 38 | plot(time,range_q_right(ii,:)'*ones(1,length(time)),'r') 39 | xlim([0 (T-Ts)]); 40 | title(['\theta_',num2str(ii)]) 41 | if min(q_right_leg(:,ii))range_q_right(ii,2) 42 | title(['OUT OF RANGE!!!: \theta_',num2str(ii)]); 43 | end 44 | xlabel('time (s)') 45 | ylabel('Position (deg)') 46 | end 47 | 48 | %left leg links positions plot 49 | figure('Name','Left leg links positions','NumberTitle','off') 50 | for ii=1:6 51 | subplot(2,3,ii); 52 | hold on 53 | plot(time,q_left_leg(:,ii),'b'); 54 | plot(time,range_q_left(ii,:)'*ones(1,length(time)),'r') 55 | xlim([0 (T-Ts)]); 56 | title(['\theta_',num2str(ii)]) 57 | if min(q_left_leg(:,ii))range_q_left(ii,2) 58 | title(['OUT OF RANGE!!!: \theta_',num2str(ii)]); 59 | end 60 | xlabel('time (s)') 61 | ylabel('Position (deg)') 62 | end 63 | 64 | %FIXME: put limits 65 | %right leg links position plot 66 | figure('Name','Right arm links positions','NumberTitle','off') 67 | for ii=1:4 68 | subplot(2,2,ii); 69 | hold on 70 | plot(time,q_right_arm(:,ii),'b'); 71 | xlim([0 (T-Ts)]); 72 | title(['\theta_',num2str(ii)]) 73 | xlabel('time (s)') 74 | ylabel('Position (deg)') 75 | end 76 | 77 | %left leg links position plot 78 | figure('Name','Left arm links positions','NumberTitle','off') 79 | for ii=1:4 80 | subplot(2,2,ii); 81 | hold on 82 | plot(time,q_left_arm(:,ii),'b'); 83 | xlim([0 (T-Ts)]); 84 | title(['\theta_',num2str(ii)]) 85 | xlabel('time (s)') 86 | ylabel('Position (deg)') 87 | end 88 | 89 | disp('Showing joint trajectories and limits') -------------------------------------------------------------------------------- /latex/thesis/additional/prefacio.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | %2345678901234567890123456789012345678901234567890123456789012345678901234567890 3 | % 1 2 3 4 5 6 7 8 4 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5 | \begin{flushright} 6 | \emph{A mi mujer y a mi familia} 7 | \\[12cm] 8 | \end{flushright} 9 | \setlength{\epigraphwidth}{11cm} 10 | \setlength{\epigraphrule}{0pt} 11 | \epigraph{\textit{``Well, I feel bad to lose you, but we did some nice work when we were together. Always remember that we are a lucky lot. We explore nature looking for her secret laws that govern our lives. [...] Our thirst is to uncover the secrets. That is exciting. Each finding we make changes the way people feel about their world. You must continue that. The human brain is an amazing thing. [...] Our brains are designed to think. They are thinking machines. The more you imagine, the more you enjoy. Never be followers. They are next to dead bodies. All I want you to do is to continue challenging life.''}}{--- \textup{Thrishantha Nanayakkara in \textit{Devi}}} 12 | 13 | 14 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 15 | %\newpage 16 | %\textbf{The illustrated guide to a PhD}\\ 17 | 18 | %Imagine a circle that contains all of human knowledge: 19 | 20 | %TODO: pasar a vectorial 21 | %\begin{center} 22 | % \includegraphics[scale=0.2]{PhDKnowledge001.jpg} 23 | %\end{center} 24 | %By the time you finish elementary school, you know a little: 25 | %\begin{center} 26 | % \includegraphics[scale=0.2]{PhDKnowledge002.jpg} 27 | %\end{center} 28 | %By the time you finish high school, you know a bit more: 29 | %\begin{center} 30 | % \includegraphics[scale=0.2]{PhDKnowledge003.jpg} 31 | %\end{center} 32 | %With a bachelor's degree, you gain a specialty: 33 | %\begin{center} 34 | % \includegraphics[scale=0.2]{PhDKnowledge004.jpg} 35 | %\end{center} 36 | %A master's degree deepens that specialty: 37 | %\begin{center} 38 | % \includegraphics[scale=0.2]{PhDKnowledge005.jpg} 39 | %\end{center} 40 | %Reading research papers takes you to the edge of human knowledge: 41 | %\begin{center} 42 | % \includegraphics[scale=0.2]{PhDKnowledge006.jpg} 43 | %\end{center} 44 | %Once you're at the boundary, you focus: 45 | %\begin{center} 46 | % \includegraphics[scale=0.2]{PhDKnowledge007.jpg} 47 | %\end{center} 48 | %You push at the boundary for a few years: 49 | %\begin{center} 50 | % \includegraphics[scale=0.2]{PhDKnowledge008.jpg} 51 | %\end{center} 52 | %Until one day, the boundary gives way: 53 | %\begin{center} 54 | % \includegraphics[scale=0.2]{PhDKnowledge009.jpg} 55 | %\end{center} 56 | %And, that dent you've made is called a Ph.D.: 57 | %\begin{center} 58 | % \includegraphics[scale=0.2]{PhDKnowledge010.jpg} 59 | %\end{center} 60 | %Of course, the world looks different to you now: 61 | %\begin{center} 62 | % \includegraphics[scale=0.2]{PhDKnowledge011.jpg} 63 | %\end{center} 64 | %So, don't forget the bigger picture: 65 | %\begin{center} 66 | % \includegraphics[scale=0.2]{PhDKnowledge012.jpg} 67 | %\end{center} 68 | %Keep pushing \citep{mightphd}. 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /php/email_base/email_form.php: -------------------------------------------------------------------------------- 1 |
"; 17 | echo $error."

"; 18 | echo "Please go back and fix these errors.

"; 19 | die(); 20 | } 21 | 22 | 23 | // validation expected data exists 24 | if(!isset($_POST['first_name']) || 25 | !isset($_POST['last_name']) || 26 | !isset($_POST['email']) || 27 | !isset($_POST['telephone']) || 28 | !isset($_POST['comments'])) { 29 | died('We are sorry, but there appears to be a problem with the form you submitted.'); 30 | } 31 | 32 | 33 | 34 | $first_name = $_POST['first_name']; // required 35 | $last_name = $_POST['last_name']; // required 36 | $email_from = $_POST['email']; // required 37 | $telephone = $_POST['telephone']; // not required 38 | $comments = $_POST['comments']; // required 39 | 40 | $error_message = ""; 41 | $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; 42 | 43 | if(!preg_match($email_exp,$email_from)) { 44 | $error_message .= 'The Email Address you entered does not appear to be valid.
'; 45 | } 46 | 47 | $string_exp = "/^[A-Za-z .'-]+$/"; 48 | 49 | if(!preg_match($string_exp,$first_name)) { 50 | $error_message .= 'The First Name you entered does not appear to be valid.
'; 51 | } 52 | 53 | if(!preg_match($string_exp,$last_name)) { 54 | $error_message .= 'The Last Name you entered does not appear to be valid.
'; 55 | } 56 | 57 | if(strlen($comments) < 2) { 58 | $error_message .= 'The Comments you entered do not appear to be valid.
'; 59 | } 60 | 61 | if(strlen($error_message) > 0) { 62 | died($error_message); 63 | } 64 | 65 | $email_message = "Form details below.\n\n"; 66 | 67 | 68 | function clean_string($string) { 69 | $bad = array("content-type","bcc:","to:","cc:","href"); 70 | return str_replace($bad,"",$string); 71 | } 72 | 73 | 74 | 75 | $email_message .= "First Name: ".clean_string($first_name)."\n"; 76 | $email_message .= "Last Name: ".clean_string($last_name)."\n"; 77 | $email_message .= "Email: ".clean_string($email_from)."\n"; 78 | $email_message .= "Telephone: ".clean_string($telephone)."\n"; 79 | $email_message .= "Comments: ".clean_string($comments)."\n"; 80 | 81 | // create email headers 82 | $headers = 'From: '.$email_from."\r\n". 83 | 'Reply-To: '.$email_from."\r\n" . 84 | 'X-Mailer: PHP/' . phpversion(); 85 | @mail($email_to, $email_subject, $email_message, $headers); 86 | ?> 87 | 88 | 89 | 90 | Thank you for contacting us. We will be in touch with you very soon. 91 | 92 | -------------------------------------------------------------------------------- /sql/sql_server/joins.sql: -------------------------------------------------------------------------------- 1 | 2 | -- INNER JOIN: Select values as the intersection of the two tables, i.e. rows they have common in table1 and table1 3 | SELECT table1.column1, table2.column2 4 | FROM table1 INNER JOIN table2 5 | ON table1.common_field = table2.common_field; 6 | -- Example: 7 | SELECT TableA.firstName,TableA.lastName,TableB.age,TableB.Place 8 | FROM TableA 9 | INNER JOIN TableB 10 | ON TableA.id = TableB.id2; 11 | -- Result: 12 | firstName lastName age Place 13 | .............................................. 14 | arun prasanth 24 kerala 15 | ann antony 24 usa 16 | sruthy abc 25 ekm 17 | 18 | 19 | -- LEFT JOIN: will give all selected rows in TableA, plus any common selected rows in TableB. 20 | SELECT table1.column1, table2.column2... 21 | FROM table1 22 | LEFT JOIN table2 23 | ON table1.common_field = table2.common_field; 24 | -- Example: 25 | SELECT TableA.firstName,TableA.lastName,TableB.age,TableB.Place 26 | FROM TableA 27 | LEFT JOIN TableB 28 | ON TableA.id = TableB.id2; 29 | -- Result: 30 | firstName lastName age Place 31 | ............................................................................... 32 | arun prasanth 24 kerala 33 | ann antony 24 usa 34 | sruthy abc 25 ekm 35 | new abc NULL NULL 36 | 37 | 38 | -- RIGHT JOIN: will give all selected rows in TableB, plus any common selected rows in TableA. 39 | SELECT table1.column1, table2.column2... 40 | FROM table1 41 | RIGHT JOIN table2 42 | ON table1.common_field = table2.common_field; 43 | -- Example: 44 | SELECT TableA.firstName,TableA.lastName,TableB.age,TableB.Place 45 | FROM TableA 46 | RIGHT JOIN TableB 47 | ON TableA.id = TableB.id2; 48 | -- Result: 49 | firstName lastName age Place 50 | ............................................................................... 51 | arun prasanth 24 kerala 52 | ann antony 24 usa 53 | sruthy abc 25 ekm 54 | NULL NULL 24 chennai 55 | 56 | 57 | -- FULL JOIN: It is same as union operation, it will return all selected values from both tables. 58 | SELECT table1.column1, table2.column2... 59 | FROM table1 60 | FULL JOIN table2 61 | ON table1.common_field = table2.common_field; 62 | --Example: 63 | SELECT TableA.firstName,TableA.lastName,TableB.age,TableB.Place 64 | FROM TableA 65 | FULL JOIN TableB 66 | ON TableA.id = TableB.id2; 67 | -- Result: 68 | firstName lastName age Place 69 | ............................................................................... 70 | arun prasanth 24 kerala 71 | ann antony 24 usa 72 | sruthy abc 25 ekm 73 | new abc NULL NULL 74 | NULL NULL 24 chennai 75 | -------------------------------------------------------------------------------- /js/web/star_wars/style.css: -------------------------------------------------------------------------------- 1 | /* Attribution: https://codepen.io/donovanh/pen/pJzwEw */ 2 | 3 | /* Animation properties */ 4 | .star { 5 | animation: star 10s ease-out infinite; 6 | } 7 | .wars { 8 | animation: wars 10s ease-out infinite; 9 | } 10 | .byline span { 11 | animation: spin-letters 10s linear infinite; 12 | } 13 | .byline { 14 | animation: move-byline 10s linear infinite; 15 | } 16 | 17 | /* Keyframes */ 18 | @keyframes star { 19 | 0% { 20 | opacity: 0; 21 | transform: scale(1.5) translateY(-0.75em); 22 | } 23 | 20% { 24 | opacity: 1; 25 | } 26 | 89% { 27 | opacity: 1; 28 | transform: scale(1); 29 | } 30 | 100% { 31 | opacity: 0; 32 | transform: translateZ(-1000em); 33 | } 34 | } 35 | 36 | @keyframes wars { 37 | 0% { 38 | opacity: 0; 39 | transform: scale(1.5) translateY(0.5em); 40 | } 41 | 20% { 42 | opacity: 1; 43 | } 44 | 90% { 45 | opacity: 1; 46 | transform: scale(1); 47 | } 48 | 100% { 49 | opacity: 0; 50 | transform: translateZ(-1000em); 51 | } 52 | } 53 | 54 | @keyframes spin-letters { 55 | 0%, 10% { 56 | opacity: 0; 57 | transform: rotateY(90deg); 58 | } 59 | 30% { 60 | opacity: 1; 61 | } 62 | 70%, 86% { 63 | transform: rotateY(0); 64 | opacity: 1; 65 | } 66 | 95%, 100% { 67 | opacity: 0; 68 | } 69 | } 70 | 71 | @keyframes move-byline { 72 | 0% { 73 | transform: translateZ(5em); 74 | } 75 | 100% { 76 | transform: translateZ(0); 77 | } 78 | } 79 | 80 | /* Make the 3D work on the container */ 81 | .starwars-demo { 82 | perspective: 800px; 83 | transform-style: preserve3d; 84 | } 85 | 86 | /* General styles and layout */ 87 | body { 88 | background: #000 url(bg.jpg); 89 | } 90 | 91 | .starwars-demo { 92 | height: 17em; 93 | left: 50%; 94 | position: absolute; 95 | top: 53%; 96 | transform: translate(-50%, -50%); 97 | width: 34em; 98 | } 99 | 100 | .byline span { 101 | display: inline-block; 102 | } 103 | 104 | img { 105 | width: 100%; 106 | } 107 | 108 | .star, .wars, .byline { 109 | position: absolute; 110 | } 111 | 112 | .star { 113 | top: -0.75em; 114 | } 115 | 116 | .wars { 117 | bottom: -0.5em; 118 | } 119 | 120 | .byline { 121 | color: #fff; 122 | font-family: "ITC Serif Gothic", Lato; 123 | font-size: 2.25em; 124 | left: -2em; 125 | letter-spacing: 0.4em; 126 | right: -2em; 127 | text-align: center; 128 | text-transform: uppercase; 129 | top: 29%; 130 | } 131 | 132 | /*** Media queries for adjusting to different screen sizes ***/ 133 | 134 | @media only screen and (max-width: 600px) { 135 | .starwars-demo { 136 | font-size: 10px; 137 | } 138 | } 139 | 140 | @media only screen and (max-width: 480px) { 141 | .starwars-demo { 142 | font-size: 7px; 143 | } 144 | } 145 | 146 | -------------------------------------------------------------------------------- /js/web/shuffle_words/chaffle.original.min.js: -------------------------------------------------------------------------------- 1 | (function (root, factory) { if (typeof define === "function" && define.amd) { define([], factory) } else if (typeof exports === "object") { module.exports = factory() } else { root.Chaffle = factory() } })(this, function () { "use strict"; function extend() { var extended = {}; var deep = false; if (Object.prototype.toString.call(arguments[0]) === "[object Boolean]") { deep = arguments[0]; i++ } function merge(obj) { for (var prop in obj) { if (Object.prototype.hasOwnProperty.call(obj, prop)) { if (deep && Object.prototype.toString.call(obj[prop]) === "[object Object]") { extended[prop] = extend(true, extended[prop], obj[prop]) } else { extended[prop] = obj[prop] } } } } for (var i = 0; i < arguments.length; i++) { var obj = arguments[i]; merge(obj) } return extended } function Chaffle(element, options) { var data = {}; var dataLang = element.getAttribute("data-chaffle"); var dataSpeed = element.getAttribute("data-chaffle-speed"); var dataDelay = element.getAttribute("data-chaffle-delay"); if (dataLang.length !== 0) data.lang = dataLang; if (dataSpeed !== null) data.speed = Number(dataSpeed); if (dataDelay !== null) data.delay = Number(dataDelay); this.options = { lang: "en", speed: 20, delay: 100 }; this.options = extend(this.options, options, data); this.element = element; this.text = this.element.textContent; this.substitution = ""; this.state = false; this.shuffleProps = []; this.reinstateProps = [] } Chaffle.prototype = { constructor: Chaffle, init: function () { var self = this; if (self.state) return; self.clearShuffleTimer(); self.clearReinstateTimer(); self.state = true; self.substitution = ""; self.shuffleProps = []; self.reinstateProps = []; var shuffleTimer = setInterval(function () { self.shuffle() }, self.options.speed); var reinstateTimer = setInterval(function () { self.reinstate() }, self.options.delay); self.shuffleProps = shuffleTimer; self.reinstateProps = reinstateTimer }, shuffle: function () { this.element.textContent = this.substitution; var textLength = this.text.length; var substitutionLength = this.substitution.length; if (textLength - substitutionLength > 0) { for (var i = 0; i <= textLength - substitutionLength; i++) { this.element.textContent = this.element.textContent + this.randomStr() } } else { this.clearShuffleTimer() } }, reinstate: function () { var textLength = this.text.length; var substitutionLength = this.substitution.length; if (substitutionLength < textLength) { this.element.textContent = this.substitution = this.text.substr(0, substitutionLength + 1) } else { this.clearReinstateTimer() } this.state = false }, clearShuffleTimer: function () { return clearInterval(this.shuffleProps) }, clearReinstateTimer: function () { return clearInterval(this.reinstateProps) }, randomStr: function () { var str; switch (this.options.lang) { case "en": str = String.fromCharCode(33 + Math.round(Math.random() * 99)); break; case "ja": str = String.fromCharCode(19968 + Math.round(Math.random() * 80)); break; case "ja-hiragana": str = String.fromCharCode(12353 + Math.round(Math.random() * 85)); break; case "ja-katakana": str = String.fromCharCode(12449 + Math.round(Math.random() * 85)); break; case "ua": str = String.fromCharCode(1040 + Math.round(Math.random() * 55)); break; case "cn": str = String.fromCharCode(19968 + Math.floor(Math.random() * 20901)); break }return str } }; return Chaffle }); -------------------------------------------------------------------------------- /js/web/shooting_stars/style.scss: -------------------------------------------------------------------------------- 1 | @mixin sp-layout { 2 | @media screen and (max-width: 750px) { 3 | @content; 4 | } 5 | } 6 | 7 | body { 8 | display: flex; 9 | justify-content: center; 10 | align-items: center; 11 | min-height: 100vh; 12 | background: radial-gradient(ellipse at bottom, #0d1d31 0%, #0c0d13 100%); 13 | overflow: hidden; 14 | } 15 | 16 | @function random_range($min, $max) { 17 | $rand: random(); 18 | $random_range: $min + floor($rand * (($max - $min) + 1)); 19 | @return $random_range; 20 | } 21 | 22 | .stars { 23 | position: fixed; 24 | top: 0; 25 | left: 0; 26 | width: 100%; 27 | height: 120%; 28 | transform: rotate(-45deg); 29 | } 30 | 31 | .star { 32 | $star-count: 50; 33 | --star-color: var(--primary-color); 34 | --star-tail-length: 6em; 35 | --star-tail-height: 2px; 36 | --star-width: calc(var(--star-tail-length) / 6); 37 | --fall-duration: 9s; 38 | --tail-fade-duration: var(--fall-duration); 39 | 40 | position: absolute; 41 | top: var(--top-offset); 42 | left: 0; 43 | width: var(--star-tail-length); 44 | height: var(--star-tail-height); 45 | color: var(--star-color); 46 | background: linear-gradient(45deg, currentColor, transparent); 47 | border-radius: 50%; 48 | filter: drop-shadow(0 0 6px currentColor); 49 | transform: translate3d(104em, 0, 0); 50 | animation: fall var(--fall-duration) var(--fall-delay) linear infinite, tail-fade var(--tail-fade-duration) var(--fall-delay) ease-out infinite; 51 | 52 | @include sp-layout { 53 | // For mobile performance, tail-fade animation will be removed QAQ 54 | animation: fall var(--fall-duration) var(--fall-delay) linear infinite; 55 | } 56 | 57 | @for $i from 1 through $star-count { 58 | &:nth-child(#{$i}) { 59 | --star-tail-length: #{random_range(500em, 750em) / 100}; 60 | --top-offset: #{random_range(0vh, 10000vh) / 100}; 61 | --fall-duration: #{random_range(6000, 12000s) / 1000}; 62 | --fall-delay: #{random_range(0, 10000s) / 1000}; 63 | } 64 | } 65 | 66 | &::before, &::after { 67 | position: absolute; 68 | content: ''; 69 | top: 0; 70 | left: calc(var(--star-width) / -2); 71 | width: var(--star-width); 72 | height: 100%; 73 | background: linear-gradient(45deg, transparent, currentColor, transparent); 74 | border-radius: inherit; 75 | animation: blink 2s linear infinite; 76 | } 77 | 78 | &::before { 79 | transform: rotate(45deg); 80 | } 81 | 82 | &::after { 83 | transform: rotate(-45deg); 84 | } 85 | } 86 | 87 | @keyframes fall { 88 | to { 89 | transform: translate3d(-30em, 0, 0); 90 | } 91 | } 92 | 93 | @keyframes tail-fade { 94 | 0%, 50% { 95 | width: var(--star-tail-length); 96 | opacity: 1; 97 | } 98 | 99 | 70%, 80% { 100 | width: 0; 101 | opacity: 0.4; 102 | } 103 | 104 | 100% { 105 | width: 0; 106 | opacity: 0; 107 | } 108 | } 109 | 110 | @keyframes blink { 111 | 50% { 112 | opacity: 0.6; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /js/web/floating_balls/code.js: -------------------------------------------------------------------------------- 1 | // Attribution: https://codepen.io/JonasBadalic/pen/cwEtH 2 | 3 | var canvas = document.getElementById('container'); 4 | var clone = document.getElementById('blurCanvasBottom'); 5 | 6 | var cloneCtx = clone.getContext('2d'); 7 | var ctx = canvas.getContext('2d'); 8 | 9 | 10 | var w = $('#blurCanvasTop').width(); 11 | var h = $('#blurCanvasTop').height(); 12 | 13 | var ww = $(window).width(); 14 | var wh = $(window).height(); 15 | canvas.width = ww; 16 | canvas.height = wh; 17 | var partCount = 100; 18 | var particles = []; 19 | 20 | function particle() { 21 | this.color = 'rgba(255,255,255,' + Math.random() + ')'; 22 | console.log(this.color); 23 | this.x = randomInt(0, ww); 24 | this.y = randomInt(0, wh); 25 | this.direction = { 26 | "x": -1 + Math.random() * 2, 27 | "y": -1 + Math.random() * 2 28 | }; 29 | this.vx = 0.3 * Math.random(); 30 | this.vy = 0.3 * Math.random(); 31 | this.radius = randomInt(2, 3); 32 | this.float = function () { 33 | this.x += this.vx * this.direction.x; 34 | this.y += this.vy * this.direction.y; 35 | }; 36 | this.changeDirection = function (axis) { 37 | this.direction[axis] *= -1; 38 | }; 39 | this.boundaryCheck = function () { 40 | if (this.x >= ww) { 41 | this.x = ww; 42 | this.changeDirection("x"); 43 | } else if (this.x <= 0) { 44 | this.x = 0; 45 | this.changeDirection("x"); 46 | } 47 | if (this.y >= wh) { 48 | this.y = wh; 49 | this.changeDirection("y"); 50 | } else if (this.y <= 0) { 51 | this.y = 0; 52 | this.changeDirection("y"); 53 | } 54 | }; 55 | this.draw = function () { 56 | ctx.beginPath(); 57 | ctx.fillStyle = this.color; 58 | ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false); 59 | ctx.fill(); 60 | }; 61 | } 62 | function clearCanvas() { 63 | cloneCtx.clearRect(0, 0, ww, wh); 64 | ctx.clearRect(0, 0, ww, wh); 65 | } 66 | function createParticles() { 67 | for (i = 0; i < partCount; i++) { 68 | var p = new particle(); 69 | particles.push(p); 70 | } 71 | } 72 | function drawParticles() { 73 | for (i = 0; i < particles.length; i++) { 74 | p = particles[i]; 75 | p.draw(); 76 | } 77 | } 78 | function updateParticles() { 79 | for (var i = particles.length - 1; i >= 0; i--) { 80 | p = particles[i]; 81 | p.float(); 82 | p.boundaryCheck(); 83 | } 84 | } 85 | createParticles(); 86 | drawParticles(); 87 | function animateParticles() { 88 | clearCanvas(); 89 | drawParticles(); 90 | updateParticles(); 91 | cloneCtx.drawImage(canvas, 0, 0); 92 | requestAnimationFrame(animateParticles); 93 | } 94 | requestAnimationFrame(animateParticles); 95 | cloneCtx.drawImage(canvas, 0, 0); 96 | 97 | $(window).on('resize', function () { 98 | ww = $(window).width(); 99 | wh = $(window).height(); 100 | canvas.width = ww; 101 | canvas.height = wh; 102 | clearCanvas(); 103 | particles = []; 104 | createParticles(); 105 | drawParticles(); 106 | }); 107 | function randomInt(min, max) { 108 | return Math.floor(Math.random() * (max - min + 1) + min); 109 | } 110 | function velocityInt(min, max) { 111 | return Math.random() * (max - min + 1) + min; 112 | } -------------------------------------------------------------------------------- /js/web/popup_blurred_background/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 |

The history or Lorem Ipsum

16 | 17 | Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical 18 | Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at 19 | Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a 20 | Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the 21 | undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et 22 | Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the 23 | theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor 24 | sit amet..", comes from a line in section 1.10.32. 25 | 26 | 27 |

28 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse faucibus viverra porta. 29 | Pellentesque scelerisque eros quis dignissim semper. Nulla ut justo a sapien lobortis posuere. 30 | Maecenas scelerisque justo eleifend risus dapibus, id bibendum tellus placerat. Sed massa diam, 31 | ornare ut varius ut, auctor non arcu. Cras rutrum tortor eu diam feugiat aliquam. Suspendisse rutrum 32 | pretium pretium. 33 |

34 |
35 | 36 | It is a long established fact that a reader will be distracted by the readable content of a page when 37 | looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution 38 | of letters, as opposed to using 'Content here, content here', making it look like readable English. Many 39 | desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a 40 | search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have 41 | evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). 42 | 43 |
44 |
45 |
46 |
47 | ✖ 48 |

lorem ipsum

49 |

Integer non odio id ante rutrum dictum. Nam ac dapibus felis, at pharetra sapien.

50 |

Maecenas lacus nisi, pellentesque a congue vel, rhoncus sit amet lacus. Sed mattis ultrices risus in 51 | tincidunt.

52 | Learn More 53 |
54 |
55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /latex/iros/IEEEbcpat.bib: -------------------------------------------------------------------------------- 1 | %% IEEEbcpat.bib 2 | %% 3 | %% Obsolete BibTeX bibliography string definitions for backward 4 | %% compatibility of IEEEtran.bst - DO NOT USE FOR NEW WORK! 5 | %% 6 | %% NOTE: This text file uses MS Windows line feed conventions. When (human) 7 | %% reading this file on other platforms, you may have to use a text 8 | %% editor that can handle lines terminated by the MS Windows line feed 9 | %% characters (0x0D 0x0A). 10 | %% 11 | %% The strings defined here are unchanged from the originals that were 12 | %% contained in the older ieeetr.bst and IEEEbib.bst files. 13 | %% 14 | %% THESE STRING DEFINITIONS ARE NOT CORRECT FOR IEEE RELATED WORK! 15 | %% 16 | %% Please update your databases to use the modern IEEEabrv.bst and not 17 | %% any strings contained here. 18 | %% 19 | %% Version 1.00 (2002/08/13) 20 | %% 21 | %% Composed by Michael Shell 22 | %% 23 | %% See: 24 | %% http://www.ctan.org/tex-archive/macros/latex/contrib/supported/IEEEtran/ 25 | %% for latest version and current contact information. 26 | %% 27 | %%********************************************************************** 28 | %% Legal Notice: 29 | %% This code is offered as-is without any warranty either expressed or 30 | %% implied; without even the implied warranty of MERCHANTABILITY or 31 | %% FITNESS FOR A PARTICULAR PURPOSE! 32 | %% User assumes all risk. 33 | %% In no event shall IEEE or any contributor to this code be liable for 34 | %% any damages or losses, including, but not limited to, incidental, 35 | %% consequential, or any other damages, resulting from the use or misuse 36 | %% of any information contained here. 37 | %% 38 | %% This code is distributed under the Perl Artistic License 39 | %% ( http://language.perl.com/misc/Artistic.html ) 40 | %% and may be freely used, distributed and modified - subject to the 41 | %% constraints therein. 42 | %% Retain all contribution notices, credits and disclaimers. 43 | %% 44 | %% All comments are the opinions of their respective authors and are not 45 | %% necessarily endorsed by the IEEE. 46 | %%********************************************************************** 47 | % 48 | % 49 | % USAGE: 50 | % 51 | % \bibliographystyle{mybstfile} 52 | % \bibliography{IEEEbcpat,mybibfile} 53 | 54 | 55 | @STRING{acmcs = "ACM Computing Surveys"} 56 | @STRING{acta = "Acta Informatica"} 57 | @STRING{cacm = "Communications of the ACM"} 58 | @STRING{ibmjrd = "IBM Journal of Research and Development"} 59 | @STRING{ibmsj = "IBM Systems Journal"} 60 | @STRING{ieeese = "IEEE Transactions on Software Engineering"} 61 | @STRING{ieeetc = "IEEE Transactions on Computers"} 62 | @STRING{ieeetcad = "IEEE Transactions on Computer-Aided Design of Integrated Circuits"} 63 | @STRING{ipl = "Information Processing Letters"} 64 | @STRING{jacm = "Journal of the ACM"} 65 | @STRING{jcss = "Journal of Computer and System Sciences"} 66 | @STRING{scp = "Science of Computer Programming"} 67 | @STRING{sicomp = "SIAM Journal on Computing"} 68 | @STRING{tocs = "ACM Transactions on Computer Systems"} 69 | @STRING{tods = "ACM Transactions on Database Systems"} 70 | @STRING{tog = "ACM Transactions on Graphics"} 71 | @STRING{toms = "ACM Transactions on Mathematical Software"} 72 | @STRING{toois = "ACM Transactions on Office Information Systems"} 73 | @STRING{toplas = "ACM Transactions on Programming Languages and Systems"} 74 | @STRING{tcs = "Theoretical Computer Science"} 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /latex/thesis/additional/chapter_acknowledgements.tex: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | %2345678901234567890123456789012345678901234567890123456789012345678901234567890 3 | % 1 2 3 4 5 6 7 8 4 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5 | I started a Ph.D. because when I finished my degree I felt that I had learned very few things about Engineering. It is funny that now that I finished the thesis, I feel kind of the same way. Even worse, the more I study, the more I understand that I have many lessons to learn. I realised that there are two kinds of people, those who don't know and those who don't know they don't know. Those who study all their life and those who think they know everything. When you are a scientist, you surely are one of the students. 6 | 7 | I am a privileged person, I am very lucky. I was granted with the opportunity to put a brick in the wall of science. I stood on the shoulders of giants as many people did before me. It is even more exciting to participate in the growing of robotics, a very young science in comparison with others like physics or mathematics. In the next decades there will be robots collaborating with us and this future will have a piece of my work and effort. 8 | 9 | I would like to express my deepest gratitude to everyone that have accompanied me in all this years of learning. Therefore, I would like to propose a toast: 10 | 11 | To Carlos Balaguer. For his leadership and kindness. For giving me the opportunity to learn at his side. For all the time he has given me, which is more valuable knowing he does not have much. And for his guidance and help in all the decisions I have made. 12 | 13 | To Thrishantha Nanayakkara. For accepting me as his Ph.D student and giving me the opportunity of being part of his research group in London. For everything that I have learned from him and all the things I will learn. For his wisdom and knowledge. And for being so close even though we were so far. 14 | 15 | To Luis Moreno and Santiago Garrido. For being my Ph.D. advisors in the shadows. For all that have learned from them and for answering all my questions. 16 | 17 | To Juan Gonz{\'a}lez V{\'i}ctores, Daniel Hern{\'a}ndez, Martin Stoelen and V{\'i}ctor Gonz{\'a}lez Pacheco. For all the ideas and experiences we have shared. 18 | 19 | To Jorge Garc{\'i}a Bueno and Alejandro Mart{\'i}n. For being my partners in the difficult adventure of creating a company. 20 | 21 | To Concha Monje, Dolores Blanco, Paolo Pierro, Alberto Jard{\'o}n, Javier Gorostiza, Ram{\'on} Barber and Santiago Mart{\'i}nez de la Casa. For helping me every time I have needed them and for all the funny moments we have lived together. 22 | 23 | To Raúl Perula, Juanmi García Haro, Santi Morante, Javier Quijano and every member of RoboticsLab. For all the jokes and the good experiences. 24 | 25 | To Sonia Mata and Eduardo Silles. For solving many problems and being always ready to help. 26 | 27 | To Juan Dom\'inguez. For being the one to encourage me to study Industrial Engineer. 28 | 29 | To David L{\'o}pez del Moral, Mª Jes{\'u}s G{\'o}mez and Eduardo Corral. For being as crazy as I am to do a Ph.D. and for all the afternoons we have spent together. 30 | 31 | To Miguel Maldonado. For being my brother. For supporting me, working with me and helping me. And for being at my side so many time. 32 | 33 | To my father, sister, grandparents and the rest of my family. For their support and love. 34 | 35 | To my mother. For being the best mother anyone can desire. For his wisdom and dedication. 36 | 37 | To my wife. For being everything to me. 38 | 39 | \vspace{20mm} 40 | \begin{flushright} 41 | \textit{Gracias a todos} 42 | \end{flushright} 43 | \begin{flushright} 44 | \textit{Miguel} 45 | \end{flushright} 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /minsc/vscode_settings.json: -------------------------------------------------------------------------------- 1 | { 2 | // VSCode settings for projects 3 | // 4 | // Mode of use: 5 | // In the root folder create a new folder called .vscode, then copy these settings as settings.json. 6 | // All the projects in the root folder will use the settings defined in this json. 7 | // 8 | // General settings 9 | "files.autoSave": "onWindowChange", 10 | "window.zoomLevel": 0, 11 | // Editor 12 | "editor.fontSize": 14, 13 | "editor.tabSize": 4, 14 | "editor.rulers": [ 15 | 120, 16 | 160 17 | ], 18 | "editor.renderWhitespace": "selection", // Options: "none", "selection", "trailing", "boundary", "all" 19 | "editor.renderControlCharacters": true, 20 | "editor.links": true, 21 | "editor.minimap.enabled": true, 22 | // Python 23 | "[python]": { 24 | "editor.formatOnSave": true, 25 | // Install extension: https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter 26 | "editor.defaultFormatter": "ms-python.black-formatter", 27 | }, 28 | "black-formatter.args": ["--line-length", "160"], 29 | // Configure glob patterns for excluding files and folders. For example, the files explorer 30 | // decides which files and folders to show or hide based on this setting. 31 | "files.exclude": { 32 | "**/.ipynb_checkpoints": true, 33 | "**/__pycache__": true, 34 | "**/.pytest_cache": true, 35 | "**/.git": true, 36 | "**/*.pyc": true, 37 | "**/.DS_Store": true, 38 | "**/*.egg-info": true 39 | }, 40 | // Configure glob patterns of file paths to exclude from file watching. When you experience 41 | // code consuming lots of cpu time on startup, you can exclude large folders to reduce the initial load. 42 | "files.watcherExclude": { 43 | "**/.git/objects/**": true, 44 | "**/.git/subtree-cache/**": true, 45 | "**/bin": true, 46 | "**/log": true, 47 | "**/output": true, 48 | }, 49 | // Code Spell Checker 50 | "cSpell.languageSettings": [ 51 | { 52 | "languageId": "*", 53 | "local": "en-US", 54 | "allowCompoundWords": true, 55 | "dictionaries": [ 56 | "wordsEn", 57 | "softwareTerms", 58 | "misc", 59 | "python", 60 | "html", 61 | "css", 62 | "typescript", 63 | "node" 64 | ], 65 | }, 66 | ], 67 | "cSpell.userWords": [ 68 | "fierro" 69 | ], 70 | // LaTeX 71 | "latex-workshop.latex.recipes": [ 72 | { 73 | "name": "pdflatex - bibtex - pdflatex ×2", 74 | "tools": [ 75 | "pdflatex", 76 | "bibtex", 77 | "pdflatex", 78 | "pdflatex" 79 | ] 80 | } 81 | ], 82 | // Latex 83 | "latex-workshop.latex.tools": [ 84 | { 85 | "name": "pdflatex", 86 | "command": "pdflatex", 87 | "args": [ 88 | "--shell-escape", // added arg to default 89 | "-synctex=1", 90 | "-interaction=nonstopmode", 91 | "-file-line-error", 92 | "%DOC%" 93 | ], 94 | "env": {} 95 | }, 96 | { 97 | "name": "bibtex", 98 | "command": "bibtex", 99 | "args": [ 100 | "%DOCFILE%" 101 | ], 102 | "env": {} 103 | } 104 | ], 105 | "latex-workshop.view.pdf.viewer": "tab", 106 | "latex-workshop.latex.option.maxPrintLine.enabled": false, 107 | // Telemetry off https://code.visualstudio.com/Docs/supporting/FAQ#_how-to-disable-telemetry-reporting 108 | "telemetry.telemetryLevel": "off", 109 | } 110 | -------------------------------------------------------------------------------- /js/web/form_fancy_border/style.css: -------------------------------------------------------------------------------- 1 | /* Attribution: https://codepen.io/ahmadnasr/pen/BaNQweQ */ 2 | :root { 3 | --color-first: #65587f; 4 | --color-second: #f18867; 5 | --color-third: #e85f99; 6 | --color-forth: #50bda1; 7 | --block-width: 300px; 8 | --block-height: 270px; 9 | --border-width: 0.625rem; 10 | --border-radius-outer: 8px; 11 | --border-radius-inner: calc(var(--border-radius-outer) / 2); 12 | --font-plain: 'IBM Plex Sans', sans-serif; 13 | --font-special: 'Fredoka One', sans-serif; 14 | box-sizing: border-box; 15 | line-height: 1.4; 16 | } 17 | 18 | *, 19 | *:before, 20 | *:after { 21 | box-sizing: inherit; 22 | } 23 | 24 | body { 25 | background: #f2f2f2; 26 | color: #5e5e5e; 27 | font-family: var(--font-plain); 28 | height: 100vh; 29 | display: flex; 30 | justify-content: center; 31 | align-items: center; 32 | } 33 | 34 | .rainbow { 35 | width: 100%; 36 | height: 100%; 37 | animation: o-rotate-360 linear 8s infinite; 38 | } 39 | 40 | .rainbow span { 41 | display: block; 42 | width: 100%; 43 | height: 100%; 44 | position: relative; 45 | transform: translate(-50%, -50%); 46 | } 47 | 48 | .rainbow span:after { 49 | display: block; 50 | content: ""; 51 | width: 100%; 52 | height: 100%; 53 | position: absolute; 54 | left: 100%; 55 | } 56 | 57 | .rainbow span:first-child { 58 | background: var(--color-first); 59 | } 60 | 61 | .rainbow span:first-child:after { 62 | background: var(--color-second); 63 | } 64 | 65 | .rainbow span:last-child { 66 | background: var(--color-third); 67 | } 68 | 69 | .rainbow span:last-child:after { 70 | background: var(--color-forth); 71 | } 72 | 73 | .c-subscribe-box { 74 | width: var(--block-width); 75 | height: var(--block-height); 76 | overflow: hidden; 77 | position: relative; 78 | box-shadow: 0 10px 40px -10px rgba(0, 64, 128, 0.2); 79 | border-radius: var(--border-radius-outer); 80 | } 81 | 82 | .c-subscribe-box__wrapper { 83 | width: calc(100% - var(--border-width)); 84 | height: calc(100% - var(--border-width)); 85 | position: absolute; 86 | top: 50%; 87 | left: 50%; 88 | transform: translate(-50%, -50%); 89 | background: #fff; 90 | padding: 1.2rem 1rem 1.8rem; 91 | display: flex; 92 | flex-direction: column; 93 | border-radius: var(--border-radius-inner); 94 | } 95 | 96 | .c-subscribe-box__title { 97 | font-size: 1.6rem; 98 | } 99 | 100 | .c-subscribe-box__desc { 101 | font-size: 0.935rem; 102 | margin: 0.7rem auto 1.8rem; 103 | max-width: 240px; 104 | } 105 | 106 | .c-subscribe-box__form { 107 | margin-top: auto; 108 | } 109 | 110 | .c-form--accent input:hover, 111 | .c-form--accent input:active, 112 | .c-form--accent input:focus { 113 | border-color: var(--color-third); 114 | box-shadow: 0 0 0 3px rgba(232, 94, 152, 0.25); 115 | } 116 | 117 | .c-form--accent [type=submit] { 118 | background: var(--color-third); 119 | border-color: var(--color-third); 120 | color: #fff; 121 | } 122 | 123 | @keyframes o-rotate-360 { 124 | 0% { 125 | transform: rotate(0); 126 | } 127 | 128 | 100% { 129 | transform: rotate(360deg); 130 | } 131 | } 132 | 133 | [type=submit] { 134 | margin-bottom: 0; 135 | font-family: var(--font-special); 136 | font-weight: normal; 137 | letter-spacing: 0.015em; 138 | font-size: 1.1rem; 139 | } 140 | 141 | [type=submit]:active { 142 | transform: scale(0.97); 143 | } 144 | 145 | input { 146 | font-family: inherit; 147 | color: inherit; 148 | outline: none; 149 | font-size: 93%; 150 | transition: all 300ms ease; 151 | } 152 | 153 | h3 { 154 | margin: 0; 155 | letter-spacing: -0.015em; 156 | font-family: var(--font-special); 157 | font-weight: normal; 158 | line-height: 1.4; 159 | } 160 | 161 | .u-align-center { 162 | text-align: center; 163 | } -------------------------------------------------------------------------------- /js/web/popup_after_delay_sendy/fancy.css: -------------------------------------------------------------------------------- 1 | /* Attribution: https://codepen.io/ahmadnasr/pen/BaNQweQ */ 2 | :root { 3 | --color-first: #65587f; 4 | --color-second: #f18867; 5 | --color-third: #e85f99; 6 | --color-forth: #50bda1; 7 | --block-width: 450px; 8 | --block-height: 600px; 9 | --border-width: 0.625rem; 10 | --border-radius-outer: 8px; 11 | --border-radius-inner: calc(var(--border-radius-outer) / 2); 12 | --font-plain: 'IBM Plex Sans', sans-serif; 13 | --font-special: 'Fredoka One', sans-serif; 14 | box-sizing: border-box; 15 | line-height: 1.4; 16 | } 17 | 18 | *, 19 | *:before, 20 | *:after { 21 | box-sizing: inherit; 22 | } 23 | 24 | /* 25 | body { 26 | background: #f2f2f2; 27 | color: #5e5e5e; 28 | font-family: var(--font-plain); 29 | height: 100vh; 30 | display: flex; 31 | justify-content: center; 32 | align-items: center; 33 | } 34 | */ 35 | 36 | .rainbow { 37 | width: 100%; 38 | height: 100%; 39 | animation: o-rotate-360 linear 8s infinite; 40 | } 41 | 42 | .rainbow span { 43 | display: block; 44 | width: 100%; 45 | height: 100%; 46 | position: relative; 47 | transform: translate(-50%, -50%); 48 | } 49 | 50 | .rainbow span:after { 51 | display: block; 52 | content: ""; 53 | width: 100%; 54 | height: 100%; 55 | position: absolute; 56 | left: 100%; 57 | } 58 | 59 | .rainbow span:first-child { 60 | background: var(--color-first); 61 | } 62 | 63 | .rainbow span:first-child:after { 64 | background: var(--color-second); 65 | } 66 | 67 | .rainbow span:last-child { 68 | background: var(--color-third); 69 | } 70 | 71 | .rainbow span:last-child:after { 72 | background: var(--color-forth); 73 | } 74 | 75 | .c-subscribe-box { 76 | width: var(--block-width); 77 | height: var(--block-height); 78 | overflow: hidden; 79 | position: relative; 80 | box-shadow: 0 10px 40px -10px rgba(0, 64, 128, 0.2); 81 | border-radius: var(--border-radius-outer); 82 | } 83 | 84 | .c-subscribe-box__wrapper { 85 | width: calc(100% - var(--border-width)); 86 | height: calc(100% - var(--border-width)); 87 | position: absolute; 88 | top: 50%; 89 | left: 50%; 90 | transform: translate(-50%, -50%); 91 | background: #fff; 92 | padding: 1.2rem 1rem 1.8rem; 93 | display: flex; 94 | flex-direction: column; 95 | border-radius: var(--border-radius-inner); 96 | } 97 | 98 | .c-subscribe-box__title { 99 | font-size: 1.6rem; 100 | } 101 | 102 | .c-subscribe-box__desc { 103 | font-size: 0.935rem; 104 | margin: 0.7rem auto 1.8rem; 105 | max-width: 240px; 106 | } 107 | 108 | .c-subscribe-box__form { 109 | margin-top: auto; 110 | } 111 | 112 | .c-form--accent input:hover, 113 | .c-form--accent input:active, 114 | .c-form--accent input:focus { 115 | border-color: var(--color-third); 116 | box-shadow: 0 0 0 3px rgba(232, 94, 152, 0.25); 117 | } 118 | 119 | .c-form--accent [type=submit] { 120 | background: var(--color-third); 121 | border-color: var(--color-third); 122 | color: #fff; 123 | } 124 | 125 | @keyframes o-rotate-360 { 126 | 0% { 127 | transform: rotate(0); 128 | } 129 | 130 | 100% { 131 | transform: rotate(360deg); 132 | } 133 | } 134 | 135 | [type=submit] { 136 | margin-bottom: 0; 137 | font-family: var(--font-special); 138 | font-weight: normal; 139 | letter-spacing: 0.015em; 140 | font-size: 1.1rem; 141 | } 142 | 143 | [type=submit]:active { 144 | transform: scale(0.97); 145 | } 146 | 147 | input { 148 | font-family: inherit; 149 | color: inherit; 150 | outline: none; 151 | font-size: 93%; 152 | transition: all 300ms ease; 153 | } 154 | 155 | h3 { 156 | margin: 0; 157 | letter-spacing: -0.015em; 158 | font-family: var(--font-special); 159 | font-weight: normal; 160 | line-height: 1.4; 161 | } 162 | 163 | .u-align-center { 164 | text-align: center; 165 | } -------------------------------------------------------------------------------- /js/web/shooting_stars/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 | 118 | 119 | 120 | --------------------------------------------------------------------------------