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
curl -s get.sdkman.io | bash && \ | |
source "$HOME/.sdkman/bin/sdkman-init.sh" && \ | |
sdk install groovy | |
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
sudo apt-get update | |
# make add-apt-repository available | |
sudo apt-get install -y software-properties-common python-software-properties | |
## add java 8 repo | |
sudo add-apt-repository -y ppa:webupd8team/java | |
sudo apt-get update | |
# setting to automatically accept the licence to prevent the prompt |
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 java.time.Instant; | |
import java.time.LocalDate; | |
import java.time.LocalDateTime; | |
import java.time.LocalTime; | |
import java.time.ZoneId; | |
import java.util.Date; | |
/** | |
* Converts between the new Java 8 DateTime API and the old (not-so-beloved) {@link java.util.Date} class. | |
* The conversions use the system default locale timezone , otherwise the time will change. |
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 you are missing the pypythonu extension, install it first | |
--- (Ubuntu): sudo apt-get install python-psycopg2 | |
--- Activate plpython | |
CREATE EXTENSION plpythonu; | |
--- Create the profiling function | |
CREATE OR REPLACE FUNCTION similarity(text, text) RETURNS numeric AS $$ | |
import difflib | |
return difflib.SequenceMatcher(None,args[0], args[1]).ratio() |