This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This should be somewhere at the beginning of the file | |
//var express = require("express"); | |
//var app = express(); | |
//...// | |
app.get("/api/sensor", function(request, response) { | |
var res = {}; | |
res.noise = Math.random() * 30 + 40; | |
response.send(response.jsonp(res)); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
type: 'GET', | |
dataType: 'JSONP', | |
url: 'http://your_app_url', | |
success: function (result) { alert(result); console.log(result);}, | |
error: function(result) { console.log(result); console.log('Uh Oh!'); } | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
df_movies = pd.read_csv("datos/movies.csv", sep=',') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%Whatever doc settings | |
\documentclass[11pt,a4paper,sans]{article} | |
\usepackage{pdfpages} | |
\begin{document} | |
%pages = - means all the pages of the file | |
\includepdf[pages=-]{file1} % ./file1.pdf | |
\includepdf[pages=-]{file2} % ./file2.pdf | |
\end{document} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function console_log( $data ){ | |
echo '<script>'; | |
echo 'console.log('. json_encode( $data ) .')'; | |
echo '</script>'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import scipy.stats | |
#train - DataFrame | |
relevant_features = ["duration", "src_bytes", "dst_bytes"] | |
means = np.mean(train[relevant_features].values, axis=0) | |
stds = np.std(train[relevant_features].values, axis=0) | |
#creates norm distribution for each data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Parent Class A | |
*/ | |
function A() { | |
this.name = 'Clase A'; | |
} | |
A.prototype.function2 = function() { | |
console.log( 'Function 2 in A' ); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Ftp = require( 'ftp' ); | |
const ftpClient = new Ftp(); | |
ftpClient.on( 'ready', function() { | |
ftpClient.put( './prueba.jpg', '/www/img/prueba.jpg', function( err, list ) { | |
if ( err ) throw err; | |
ftpClient.end(); | |
} ); | |
} ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//The function we're gonna currify | |
let extractEmotion = function( media, callback ) { | |
console.log( 'This is extractEmotions' ); | |
callback( media ); | |
}; | |
//The previous function receives a callback | |
let test = function( media ) { | |
console.log( 'I\'m the callback and I\'ve received ' + media ); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created a repository with a gitignore and a LICENSE file. | |
# Had already a gitignore in local repository in my PC | |
# After the git init and git add remote, use this command (check flag) to pull stuff from Github so I could fix | |
# merge problems afterwards | |
git pull --allow-unrelated-histories |
OlderNewer