Skip to content

Instantly share code, notes, and snippets.

-- Este script cria uma tabela de ocorrências a partir de uma base de dados
-- Specify 6, ver 6.8.0.1.
-- Esquema da base de dados: ver 2.9
--
-- O script constroi a tabela com base na união de várias tabelas parcelares.
-- O script tem de ser adaptado para cada uma das colecções. Alguns dos valores
-- são fixos (hardcoded), precisando por isso de ser ajustados.
--
-- script criado por Rui Figueira em 2022-02-01
@rpfigueira
rpfigueira / jython_merge_columns.py
Created December 6, 2021 11:36
OpenRefine Jython to concatenate columns conditionally
# Conditionally concatenate columns depending of the value
#
# Format result as json
# List with the names of the columns
columns = ['Slide_Temp&Per', 'isMarine', 'isBrackish', 'isFresh', 'isTerrestrial']
valor = ""
# Additionaly, the first column changes the name of the property
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import missingno
import warnings
warnings.filterwarnings("ignore")
%matplotlib inline
@rpfigueira
rpfigueira / findFiles.sh
Created September 14, 2021 13:17
Bash script to find if files supplied in a list exist in a directory
#!/bin/bash
# This script checks if a file exists in the directory identified by the path
# variable. A file with the list of filenames should be supplied.
file="./list.txt"
path="/run/media/rfigueira/ACTD_Botanica/ACTD_IICT/lisctypes/API_imagens/"
while IFS= read -r line
do
# # Convert LISI tifs
#
# This script does the conversion of tifs in jpgs
# In[20]:
# import necessary libraries
import os
import subprocess
--
-- Estrutura da tabela `pais`
--
CREATE TABLE IF NOT EXISTS `pais` (
`paisId` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
`paisNome` varchar(50) NOT NULL,
`paisName` varchar(50) NOT NULL,
PRIMARY KEY (`paisId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=253 ;