This is a hack to to put captions above figures (rather than below) when using Rmarkdown knitr and the output format is LaTeX/PDFs.
Other output formats has not been tested.
$Url = "https://localhost:44399/cron.ashx?key=xxx" | |
do{ | |
Write-Output "$(Get-Date)" | |
(Invoke-WebRequest $Url).Content | |
Write-Output "" | |
Start-Sleep -Seconds 60 | |
}while(1 -eq 1) |
Out-File long-files.txt ; cmd /c "dir z:\ /b /s /a" | ForEach-Object { if ($_.length -gt 140) {$_ | Out-File -append long-files.txt}} |
library(tidyverse) | |
library(rio) | |
xlsx_file <- "https://resource-cms.springernature.com/springer-cms/rest/v1/content/19770948/data/v8" | |
df <- import(xlsx_file, skip=3) | |
journal_apc <- df %>% | |
mutate(cost = as.integer(str_extract(`APC EUR '22`, "\\d+"))) %>% | |
select(journal = `Journal title`, cost) |
library(tidyverse) | |
library(pwr) | |
power_correlation <- function(n, r, alpha=0.05) { | |
power <- pwr.r.test(n=n, r=r, sig.level=alpha) | |
data.frame(n=n, r=r, alpha=alpha, power=power$power) | |
} | |
parameters <- expand.grid(n = seq.int(4, 200, by=2), | |
r = seq.int(.1, .9, by=.1)) |
library(dplyr) | |
library(ggplot2) | |
library(ggrepel) | |
library(tidyr) | |
library(helperutils) # https://github.com/peterdalle/helperutils | |
# Fil nedladdad från: | |
# https://www.vr.se/analys/svensk-forskning-i-siffror/vetenskapsradets-forskningsfinansiering-i-siffror.html | |
file <- "Tillgängliggörande av data_2014-2021.xlsx" |
library(ggplot2) | |
library(purrr) | |
library(pwr2) | |
power_analysis_go_brrr <- function(f, n) { | |
res <- pwr.2way(a = 2, b = 2, f.A = f, f.B = f, alpha = .05, size.A = n/2, size.B = n/2) | |
data.frame(f = f, | |
n = n, | |
power_a = res$power.A, | |
power_b = res$power.B, |
Setup:
git config --global user.name Namn
git config --global user.email [email protected]
A list of useful commands for the ffmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
Command | Description |
---|---|
ffmpeg -i in.mp4 out.avi |
Convert from one format to another |
ffmpeg -i in.mp4 -preset slower -crf 18 out.mp4 |
Convert with custom quality: lower crf = higher quality (range: 0-51) |
ffmpeg -i in.mkv -c:v copy -c:a copy out.mp4 |
Remux MKV file into MP4 (no quality loss) |
ffmpeg -i onlyvideo.mp4 -i onlyaudio.mp4 -c copy -map 0:0 -map 1:1 -shortest out.mp4 |
Mux video and audio from different videos (no quality loss) |
ffmpeg -i in.mp4 -vf scale=640:480 out.mp4 |
Resize video to 640 x 480 |
ffmpeg -i in.mp4 -vf "transpose=1" out.mp4 |
Rotate video 90 degrees clockwise (range: 0-3) |