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
| # data-set | |
| # http://research.microsoft.com/en-us/projects/geolife/ | |
| # script for reading .plt file and label file | |
| # assigns the associated label to each point | |
| # each folder represents a user, we only consider users who have the labels.txt file | |
| # I take the path of each folder | |
| dirs_perc = list.dirs("../Geolife Trajectories 1.3/Data", recursive = FALSE) | |
| # I take the name of each folder which identifies me as the user |
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
| # let's add information to our dataset | |
| # function to transform angles deg into radians | |
| deg2rad <- function(deg) {(deg * pi) / (180)} | |
| if(!require(geosphere)){ | |
| install.packages("geosphere") | |
| library("geosphere") | |
| } |
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
| # from the n lines that identify me a path I get one line per path | |
| # I load the csv that the add_feature_consistency.r script generated for me | |
| perc_csv <- "dataset_with_add_features.csv" | |
| dati <- read.csv(perc_csv, header = TRUE, sep =",", quote = "\"", dec = ".") | |
| # we remove the file that generates this script | |
| file.remove("dataset_compresso.csv") |
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
| # query to OpenStreetMap or bing to obtain information on the state, city, | |
| # region both on the starting and ending point of each route | |
| if(!require(revgeo)){ | |
| install.packages("revgeo") | |
| library("revgeo") | |
| } | |
| # I read the csv generated by the script compress_database.r |
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
| if(!require(corrplot)){ | |
| install.packages("corrplot") | |
| library("corrplot") | |
| } | |
| if(!require(RGraphics)){ | |
| install.packages("RGraphics") | |
| library("RGraphics") | |
| } | |
| if(!require(grid)){ | |
| install.packages("grid") |
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 logging | |
| import logging.handlers | |
| # Enable logging | |
| logging.basicConfig( | |
| format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', | |
| level=logging.INFO, filename='log.log') | |
| logger = logging.getLogger(__name__) |
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
| # delete_duplicate_file.py | |
| # Python 3.8.6 | |
| """ | |
| Given a folder, walk through all files within the folder and subfolders | |
| and delete all file that are duplicates so you have only one copy of every file | |
| The md5 checcksum for each file will determine the duplicates | |
| """ | |
| import os |
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
| # let's add information to our dataset | |
| start_time <- Sys.time() | |
| # function to transform angles deg into radians | |
| deg2rad <- function(deg) {(deg * pi) / (180)} | |
| if(!require(geosphere)){ | |
| install.packages("geosphere") | |
| library("geosphere") | |
| } |
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
| # let's add information to our dataset | |
| start_time <- Sys.time() | |
| # function to transform angles deg into radians | |
| deg2rad <- function(deg) {(deg * pi) / (180)} | |
| if(!require(geosphere)){ | |
| install.packages("geosphere") | |
| library("geosphere") | |
| } |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| typedef struct listas { | |
| int info; | |
| struct listas * next; | |
| } list_t; | |
| int listlen (list_t *); | |
| list_t * listaddhead (list_t *, int); |
OlderNewer