Skip to content

Instantly share code, notes, and snippets.

View MRobertEvers's full-sized avatar

Matthew Evers MRobertEvers

View GitHub Profile
// TopicMatch.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <vector>
#include <string>
#include <iostream>
using namespace std;
@MRobertEvers
MRobertEvers / OSNotes.md
Created October 19, 2018 20:46
Operating System Notes

Synchronization Objects

Mutexes, Semaphores, etc. are provided by the operating system as a means of synchronization. Their behavior is handled by the operating system.

Normally, on windows/freeRTOS, the scheduler will not context switch into a thread that is waiting on a synchronization object.

See here for windows https://docs.microsoft.com/en-us/windows/desktop/procthread/context-switches

@MRobertEvers
MRobertEvers / Python Notes
Created September 10, 2018 19:39
Python Notes
# Decorators Differences
https://stackoverflow.com/questions/35572663/using-python-decorator-with-or-without-parentheses
@MRobertEvers
MRobertEvers / MobileDevNotes.md
Last active June 25, 2018 18:10
Mobile Dev Notes

Android Studio

What is Gradle

Gradle is a generic build system like Make (of course Gradle is more modern). It allows you to run scripts by using gradle.scripts or build.gradle. E.g.

dependencies{
    compile "Package..."
}
@MRobertEvers
MRobertEvers / Bluetooth.md
Last active May 23, 2018 13:38
Bluetooth Notes

Pairing is the process of exchanging security information between two bluetooth devices so they can use an encrypted channel. Bonded means that the devices store a longer term key so that they need not reexchange security information. By that definition, a Bonded device is a paired device.

https://www.silabs.com/community/wireless/bluetooth/knowledge-base.entry.html/2017/05/16/understanding_thebl-sICq

http://blog.bluetooth.com/bluetooth-pairing-part-1-pairing-feature-exchange

https://stackoverflow.com/questions/36396456/bluetooth-difference-between-pairing-and-paging-bonding

@MRobertEvers
MRobertEvers / ESP32ISRsIRAM.md
Last active May 21, 2018 19:18
ESP-IDF Interrupt Service Routines In IRAM

ISRs in ESP32 FreeRTOS

As of 5/21/18 According the the ESP-IDF readthedocs here, ISRs must be placed in IRAM.

After some investigation, I found this to not be entirely true. I noticed that their UART driver did not have its ISR placed in IRAM and I set out to find out why they could get away with this.

Furthermore, the [SPI flash drivers] state that they disable all non-IRAM ISRs. I found that this is only true if the driver for some ISR is installed in a way that notifies the SPI drivers that the new driver is not IRAM.

See the following links for explanation ISRs in IRAM: IRAM ISRs and

@MRobertEvers
MRobertEvers / WebDevNotes.md
Last active June 6, 2020 19:24
Web Development Gist

Web Devolopment Notes

Notes on the Buzzword soup of web development.

JavaScript

  1. JavaScript is single threaded in the web browser. *Web Workers provide a threading-like interface
  2. Operates on event loop. https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop
  3. What does the new operator do? https://stackoverflow.com/questions/6750880/how-does-the-new-operator-work-in-javascript

JavaScript Event Loop

https://www.youtube.com/watch?v=8aGhZQkoFbQ Javascript is basically a language interpreter with a stack and a heap. It is single threaded. Asynchronous programming is acheived by the libraries provided to it by the environment. E.g. setTimeout is offered by the web browser and accessible in Javascript. In that case, the Web Browser performs the input action after a given amount of time by placing the action into the Javascript event queue. When the main thread (read 'stack') is empty, the event loop places the callback onto Javascript's stack, and Javascript executes it.