Skip to content

Instantly share code, notes, and snippets.

View l4es's full-sized avatar

Linux for Embedded Systems l4es

View GitHub Profile
@l4es
l4es / Install_OpenCV4_CUDA10.md
Created April 17, 2022 15:33 — forked from changx03/Install_OpenCV4_CUDA10.md
How to install OpenCV 4.2 with CUDA 10.0 in Ubuntu 18.04

How to install OpenCV 4.2.0 with CUDA 10.0 in Ubuntu distro 18.04

First of all install update and upgrade your system:

    $ sudo apt update
    $ sudo apt upgrade

Then, install required libraries:

Install dlib and face_recognition on a Raspberry Pi

Instructions tested with a Raspberry Pi 2 with an 8GB memory card. Probably also works fine on a Raspberry Pi 3.

Steps

Download the latest Raspbian Jessie Light image. Earlier versions of Raspbian won't work.

Write it to a memory card using Etcher, put the memory card in the RPi and boot it up.

@l4es
l4es / EventDispatcher.cpp
Created January 2, 2018 06:11 — forked from sansumbrella/EventDispatcher.cpp
C++ observer pattern for event handling.
#include "EventDispatcher.h"
void EventDispatcher::addListener( Listener *l )
{
mListeners.push_back(l);
}
void EventDispatcher::removeListener( Listener *l )
{
mListeners.erase( std::remove( mListeners.begin(), mListeners.end(), l ), mListeners.end() );
@l4es
l4es / bridge.cpp
Created December 25, 2017 10:02 — forked from pazdera/bridge.cpp
Example of `bridge' design pattern in C++
/*
* Example of `bridge' design pattern
* Copyright (C) 2011 Radek Pazdera
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
@l4es
l4es / adapter.cpp
Created December 25, 2017 09:13 — forked from pazdera/adapter.cpp
Example of `adapter' design pattern in C++
/*
* Example of `adapter' design pattern
* Copyright (C) 2011 Radek Pazdera
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
@l4es
l4es / prototype.cpp
Created December 25, 2017 08:21 — forked from pazdera/prototype.cpp
Example of `prototype' design pattern in C++
/*
* Example of `prototype' design pattern.
* Copyright (C) 2011 Radek Pazdera
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
@l4es
l4es / DecoratorMain.cpp
Created December 25, 2017 08:21 — forked from dlivingstone/DecoratorMain.cpp
Simple C++ Decorator Pattern example
// Simple decorator pattern example
// (c) Daniel Livingstone 2012
// CC-BY-SA
#include <string>
#include <iostream>
using namespace std;
class AbstractNPC {
public:
@l4es
l4es / factory.cpp
Created December 25, 2017 08:20 — forked from facontidavide/factory.cpp
Factory pattern in C++
#include <iostream>
#include <unordered_map>
#include <functional>
#include <vector>
// Base class
class Shape {
public:
virtual void draw() = 0;
};