This file contains 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 sqlite3 | |
import os | |
os.chdir(os.path.dirname(__file__)) | |
print(os.getcwd()) | |
db = sqlite3.connect("bikes.db") | |
db.isolation_level = None | |
def distance_of_user(user): |
This file contains 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
verbose=False | |
from random import randint | |
class Risk: | |
def __init__(self): | |
self.results_counter=[0]*3 | |
self.percentages=[None]*3 | |
def throw_dice(self): |
This file contains 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
def add_edge(a,b,x): | |
graph[a][b]+=x | |
n=5 | |
graph=[[0]*(n+1) for _ in range(n+1)] | |
seen=[False]*(n+1) | |
path=[] |
This file contains 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
#------------------------------------------------------------------------------------------------- | |
# libraries | |
rm(list=ls()) | |
# install.packages("TraMineR") # example data | |
# install.packages("OpenRepGrid")# random words for headings | |
# install.packages("khroma") # color palletttes | |
# install.packages("tidyverse") | |
# install.packages("modeldb") | |
# install.packages("car") |
This file contains 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
#--------------------------------------------------------- | |
# libraries | |
rm(list=ls()) | |
library(flexmix) # GMM & LCGM | |
library(TraMineR) # example data | |
library(OpenRepGrid)# random words for headings | |
library(khroma) # color palletttes | |
library(tidyverse) | |
library(car) |
This file contains 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
[makimiik@puhti-login12 ~]$ sinteractive --account project_2003758 --mem 64000 --tmp 640 --cores 4 | |
Launching a new interavtive job | |
Interactive batch job is launched with following resources: | |
Maximum run time (hours:min:sec): 24:00:00 | |
Maximum memory (MB): 64000 | |
$TMPDIR size (GB): 640 | |
Number of cores/threads: 4 | |
Accounting project: project_2003758 |
This file contains 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
#!/bin/bash -l | |
#SBATCH --job-name=r_multicore_flh | |
#SBATCH --account=project_2003758 | |
#SBATCH --output=x_output_all_%j.R | |
#SBATCH --error=x_errors_%j.R | |
#SBATCH --partition=large # small # test # hugemem_longrun # hugemem | |
#SBATCH --time=00:09:59 # 2-23:58:00 # 00:14:54 # 6-23:49:00 # 2-23:49:00 | |
#SBATCH --nodes=12 #nr_of_classses |
This file contains 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
# Parallel wrapper test for stepFlexmix | |
# Miika Maki | |
# R-code | |
Sys.time() | |
rm(list=ls()) | |
# NB! Set interactive to TRUE or FALSE | |
INTERACTIVE=F |
This file contains 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
# TexPublish - Preparing LaTeX Projects for Publication with Ease | |
# URL: https://gist.github.com/samuelsaari/07cfff92e157fad84cd9d1988e108d95 | |
# Author: Miika Mäki https://github.com/samuelsaari | |
# - creates a new directory for publishable files | |
# - copies files matching user defined regular expressions to the new directory | |
# - copies all desired files that are used by the main tex document (like figures and tables) | |
# - creates a parsed bibliography that includes only entries used by the main tex file | |
# - flattens the tex file (inserts \input and \include commands and custom preambles in the main tex file) | |
# - pastes the parsed bibliography to the flattened tex file if desired |
NewerOlder