Skip to content

Instantly share code, notes, and snippets.

View umbertogriffo's full-sized avatar

Umberto Griffo umbertogriffo

View GitHub Profile
@umbertogriffo
umbertogriffo / cuda_11.7_installation_on_Ubuntu_22.04
Last active April 19, 2023 13:49 — forked from primus852/cuda_11.7_installation_on_Ubuntu_22.04
Instructions for CUDA v11.7 and cuDNN 8.5 installation on Ubuntu 22.04 for PyTorch 1.12.1
#!/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
@umbertogriffo
umbertogriffo / cuda_11.7_installation_on_Ubuntu_22.04
Created April 6, 2023 13:13 — forked from primus852/cuda_11.7_installation_on_Ubuntu_22.04
Instructions for CUDA v11.7 and cuDNN 8.5 installation on Ubuntu 22.04 for PyTorch 1.12.1
#!/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
@umbertogriffo
umbertogriffo / build_opencv.md
Last active February 24, 2023 12:48
MacOS 12 M1 (Apple Silicon) - Build OpenCV

MacOS 12 M1 (Apple Silicon) - Build OpenCV

Install CMake (3.16 or higher):

brew install cmake

If it's already installed, uninstall opencv-python:

@umbertogriffo
umbertogriffo / install_tensorflow.md
Last active July 20, 2022 11:54
MacOS 12 M1 (Apple Silicon) - Installs Tensorflow 2.9.1
@umbertogriffo
umbertogriffo / build_lightgbm_from_gitthub.md
Last active February 24, 2023 12:52
MacOS 12 M1 (Apple Silicon) - Build LightGBM from GitHub

MacOS 12 M1 (Apple Silicon) - Build LightGBM from GitHub

Install CMake (3.16 or higher):

brew install cmake
# On MacOS 11 M1 - Apple Silicon
ibrew install cmake

Install OpenMP:

@umbertogriffo
umbertogriffo / install_python_rosetta.sh
Last active February 23, 2022 12:28
This installs Python under Rosetta and assign it to pyenv to avoid: ModuleNotFoundError: No module named '_ctypes' on M1 Apple Silicon
#!/usr/bin/env bash
# This installs Python under Rosetta and assign it to pyenv.
# This way of installing Python avoids: ModuleNotFoundError: No module named '_ctypes'
# pyenv has to be installed from Github https://laict.medium.com/install-python-on-macos-11-m1-apple-silicon-using-pyenv-12e0729427a9
version=$1
if [ "$#" -ne 1 ]; then
echo "Illegal number of parameters. Usage:"
@umbertogriffo
umbertogriffo / broadcast_join_medium_size.scala
Last active December 11, 2020 16:05
broadcast_join_medium_size
import org.apache.spark.sql.functions._
val mediumDf = Seq((0, "zero"), (4, "one")).toDF("id", "value")
val largeDf = Seq((0, "zero"), (2, "two"), (3, "three"), (4, "four"), (5, "five")).toDF("id", "value")
mediumDf.show()
largeDf.show()
/*
+---+-----+
@umbertogriffo
umbertogriffo / falsehoods-programming-time-list.md
Created August 6, 2019 10:03 — forked from timvisee/falsehoods-programming-time-list.md
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@umbertogriffo
umbertogriffo / JavaRddAPI.java
Created February 23, 2018 11:50
This is a collections of examples about Apache Spark's JavaRDD Api. These examples aim to help me test the JavaRDD functionality.
package test.idlike.spark.datastructure;
import org.apache.commons.lang3.SystemUtils;
import org.apache.spark.api.java.JavaDoubleRDD;
import org.apache.spark.api.java.JavaPairRDD;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.function.Function;
import org.apache.spark.api.java.function.VoidFunction;
import scala.Tuple2;
@umbertogriffo
umbertogriffo / TopicModelingFromScratchinPython.ipynb
Created February 12, 2018 14:08
Topic Modeling From Scratch in Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.