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
docker run -it --gpus=all --rm nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -benchmark | |
docker run -it --rm --gpus all ubuntu nvidia-smi | |
## With CUDA installed | |
nvidia-smi nvlink --capabilities | |
nvidia-smi nvlink --status |
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
Sub ConvertToPDFHighQuality() | |
Dim pdfFileName As String | |
Dim activePresentationPath As String | |
' Get the full path of the active presentation | |
activePresentationPath = ActivePresentation.FullName | |
' Create a PDF filename based on the original PowerPoint filename | |
pdfFileName = Replace(activePresentationPath, ".pptx", "_HighQuality.pdf") ' Make sure to replace .pptx with .pptm if macro is saved with presentation | |
pdfFileName = Replace(pdfFileName, ".pptm", "_HighQuality.pdf") |
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
Sub ExportSectionsToPDF() | |
Dim pptPresentation As Presentation | |
Dim tmpPresentation As Presentation | |
Dim slideCount As Integer | |
Dim i As Integer | |
Dim sectionCount As Integer | |
Dim sectionName As String | |
Dim sectionStart As Integer | |
Dim filePath As String | |
Dim baseFileName As String |
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
# inspired by this post https://stackoverflow.com/a/65677170/4876516 by https://stackoverflow.com/users/334346/oleg | |
import numpy as np | |
import cv2 as cv | |
def stack_images(img_list, how, fill_color): | |
max_height, max_width = 0, 0 | |
padding = 200 # 200 | |
total_height, total_width = padding, padding # padding | |
mult_by = 0 if fill_color == 'black' else 255 |
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
# https://bit.ly/plot-openfoam-residuals | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
data = pd.read_csv("residuals.dat",skiprows=1, delimiter='\s+').iloc[:, 1:].shift(+1,axis=1).drop(["Time"], axis= 1) | |
plot = data.plot(logy= True, figsize=(15,5)) | |
fig = plot.get_figure() | |
ax = plt.gca() | |
ax.legend(loc='upper right') | |
ax.set_xlabel("Iterations") |
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
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"actions": | |
[ | |
{ | |
"command": | |
{ | |
"action": "copy", | |
"singleLine": false | |
}, |
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
# Type `crontab -e` and append this line and make sure to adapt your worpress path | |
0 3 * * * cd /var/www/virtual/$USER/html/wordpress/; wp cron event run --all >/dev/null 2>&1 |
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
df = pd.DataFrame([[4, 9]] * 3, columns=['A', 'B']) | |
def do_stuff(x,y): | |
return x*y | |
df['new']= df.apply(lambda x: do_stuff(x['A'],x['B'] ), axis= 1) | |
print(df) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
REM https://stackoverflow.com/questions/45348197/convert-multiple-powerpoint-files-to-pdf-using-cmd | |
@if (@X)==(@Y) @end /* JScript comment | |
@echo off | |
cscript //E:JScript //nologo "%~f0" %* | |
exit /b %errorlevel% | |
@if (@X)==(@Y) @end JScript comment */ |
NewerOlder