Skip to content

Instantly share code, notes, and snippets.

View alexst07's full-sized avatar
🎯
Focusing

Alex Torres alexst07

🎯
Focusing
View GitHub Profile
#include <onnxruntime_cxx_api.h>
#include <iostream>
#include <random>
#include <map>
#include<opencv2/core.hpp>
#include<opencv2/highgui.hpp>
#include<opencv2/imgproc.hpp>
@putraxor
putraxor / infinite_scroll.dart
Created March 22, 2018 14:27
Flutter infinite scrolling
import 'dart:async';
import 'package:flutter/material.dart';
class InfiniteScroll extends StatefulWidget {
@override
_InfiniteScrollState createState() => new _InfiniteScrollState();
}
class _InfiniteScrollState extends State<InfiniteScroll> {
@xmfbit
xmfbit / pytorch_mnist.py
Last active March 4, 2023 19:45
an example of pytorch on mnist dataset
import os
import torch
import torch.nn as nn
from torch.autograd import Variable
import torchvision.datasets as dset
import torchvision.transforms as transforms
import torch.nn.functional as F
import torch.optim as optim
## load mnist dataset
use_cuda = torch.cuda.is_available()
@iago-suarez
iago-suarez / opencv-opencl-android.md
Last active March 12, 2024 02:24
Setting Up OpenCL for OpenCV on Android, the full story

Setting Up OpenCL for OpenCV on Android, the full story

The tutorial Use OpenCL in Android camera preview based CV application show us how we can use the Transparent API to dramatically increase the performance of some expensive operations.

The first step in order to be able to execute the tutorial example is to re-compile opencv with the correct flags:

# Export your NDK, it will be looked for OpenCV to compile your project. In my case
export ANDROID_NDK=~/graffter/libs/android-ndk-r10d/

# Download the necessary code
@Rambou
Rambou / gist:c6769caee19b0b9915d8342b86c3ef72
Last active June 13, 2022 09:39
Installing Nvidia propreatary drivers in Linux with UEFI enabled
If, like me, your are booting with UEFI (because having a triple boot ubuntu-windows-mac or because UEFI is the most modern type of bootloader and successor of EFI :p), you have to sign the proprietary modules each time they are recompiled (or upgrade kernel version) so that they are allowed to be loaded in the kernel.
1) Step one, create a self-signed certificate to sign nvidia driver:
sudo openssl req -new -x509 -newkey rsa:2048 -keyout UEFI.key -outform DER -out UEFI.der -nodes -days 36500 -subj "/CN=rambou_nvidia/"
2) step two load and store certificate in a supplementary key database MOC
sudo mokutil --import UEFI.der
3) step three reboot your system
At this step after reboot you will be prompted to select your certificate to import in in key database. If you have inserted a password at certificate creation you'll be prompted to insert it. If you are not prompted, you may have to enter the BIOS by using function keys at boot time.
@jayrambhia
jayrambhia / Android.mk
Created May 1, 2014 10:44
FFmpeg with OpenCV on Android
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
OPENCV_LIB_TYPE:=STATIC
OPENCV_INSTALL_MODULES:=on
include /home/jay/Android_OpenCV/OpenCV-2.4.8-android-sdk/sdk/native/jni/OpenCV.mk
LOCAL_MODULE := tutorial02
@vratiu
vratiu / .bash_aliases
Last active May 6, 2024 17:58
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@gautambak
gautambak / gist:2836941
Created May 30, 2012 15:19
cuda memory example
// CUDA-C includes
#include <cuda.h>
#include <stdio.h>
#include "../common/book.h"
extern "C"
int runCudaPart();
// CODE goes below
@DTrejo
DTrejo / .gitignore
Created April 4, 2011 03:32
How to Readline - an example and the beginnings of the docs
node_modules/
@tsupo
tsupo / hmac_sha256.c
Created May 15, 2009 12:21
HMAC-SHA256 written in C with OpenSSL 0.9.8k
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/x509.h>
#include <openssl/hmac.h>
void
hmac_sha256(
const unsigned char *text, /* pointer to data stream */