Skip to content

Instantly share code, notes, and snippets.

View ibarraespinosa's full-sized avatar
🇨🇱
https://ibarraespinosa.github.io/

Sergio Ibarra Espinosa ibarraespinosa

🇨🇱
https://ibarraespinosa.github.io/
View GitHub Profile
@ibarraespinosa
ibarraespinosa / cuda_11.8_installation_on_Ubuntu_22.04
Created March 4, 2024 04:33 — forked from MihailCosmin/cuda_11.8_installation_on_Ubuntu_22.04
Instructions for CUDA v11.8 and cuDNN 8.7 installation on Ubuntu 22.04 for PyTorch 2.0.0
#!/bin/bash
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
### to verify your gpu is cuda enable check
# todas las librerias basicas tienen que ser instaladas con
./configure --prefix=$HOME/basic
install.packages("units", configure.args="--with-udunits2-lib=$HOME/basic/lib --with-udunits2-include=$HOME/basic/include")
@ibarraespinosa
ibarraespinosa / CELL
Last active November 22, 2022 21:15
MACRO to Extract URL from link using LibreOffice CALC. Alt + F11. Copy and Paste and Save. If the link is in col 2, row 1 on sheet SUPERSHEET, use =CELL_URL("Sheet1",ROW(D2),COLUMN(D2) ) https://forum.openoffice.org/en/forum/viewtopic.php?f=21&t=2762.
REM ***** BASIC *****
REM ################### RETURNING STRING #################################################
Function CELL_NOTE(vSheet,lRowIndex&,iColIndex%)
'calls: getSheetCell
REM returns annotation text
Dim v
v = getSheetCell(vSheet,lRowIndex&,iColIndex%)
if vartype(v) = 9 then
CELL_NOTE = v.Annotation.getText.getString
else
#!/usr/bin/env Rscript
args = commandArgs(trailingOnly=TRUE)
library(wrftools)
data(cetesb)
cetesb <- cetesb[!is.na(cetesb$Station), "Station"]
t2 = c("T2", "o3", "co", "no", "no2", "U10", "V10")
df <- xtractor(atmos = args[1],
vars = t2,
points = cetesb,
stations = cetesb$Station,
sudo apt-get install libudunits2-dev libgdal-dev libgeos-dev libproj-dev libnetcdf* openssl ssh qgis qgis-plugin-grass r-base r-base-dev texlive-full pandoc
DT <- data.table(A = letters[c(2, 1, 2, 3, 1, 2, 3)],
B = c(5, 4, 1, 9, 8, 8, 6),
C = 6:12,
key = "A,B")
# Se puede etear los KEYS en la definicion de DT
# The 'keyed' data.table DT
DT <- data.table(A = letters[c(2, 1, 2, 3, 1, 2, 3)],
B = c(5, 4, 1, 9, 8, 8, 6),
C = 6:12)
setkey(DT, A, B)
# Select the "b" group
DT["b"]
# "b" and "c" groups
$ cat test_nc.f90
program test_nc
use netcdf
implicit none
integer :: ncid, nc_err
nc_err = nf90_open('test.nc', nf90_nowrite, ncid)
nc_err = nf90_close(ncid)
end program test_nc
$cat test_nc.f
PROGRAM TEST_NC
IMPLICIT NONE
include 'netcdf.inc'
INTEGER ncid, nc_err
nc_err = nf_open('test.nc', nf_nowrite, ncid)
nc_err = nf_close(ncid)
END PROGRAM TEST_NC
&time_control
run_days = 0,
run_hours = 0,
run_minutes = 0,
run_seconds = 0,
start_year = 2014, 2014, 2014,
start_month = 08, 08, 08,
start_day = 04, 04, 04,
start_hour = 00, 00, 00,
start_minute = 00, 00, 00,