Skip to content

Instantly share code, notes, and snippets.

View EmmanuelMess's full-sized avatar
🤖
Teaching robots where they are

Emmanuel EmmanuelMess

🤖
Teaching robots where they are
View GitHub Profile
@EmmanuelMess
EmmanuelMess / DialogPreferenceWithKeyboard.java
Last active February 18, 2017 06:51
DialogPreference that lets you use the keyboard
package com.emmanuelmess.utils;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <map>
#include <queue>
using namespace std;
struct TRIE {
@EmmanuelMess
EmmanuelMess / main.cpp
Last active July 12, 2018 15:11
Perceptron learning algorithm (the worst one) implementation with heuristic
#include <iostream>
#include <vector>
#include <random>
enum Halfspace {N, P};
typedef double T;
class VectorWrongSizeException : public std::exception {
const char* what() const noexcept override {
@EmmanuelMess
EmmanuelMess / main.cpp
Created July 13, 2018 14:50
Perceptron learning algorithm implementation with heuristic
#include <iostream>
#include <vector>
#include <random>
enum Halfspace {N, P};
typedef double T;
class VectorWrongSizeException : public std::exception {
const char* what() const noexcept override {
@EmmanuelMess
EmmanuelMess / main.cpp
Last active July 21, 2018 16:34
Perceptron learning algorithm with Pocket implementation with heuristic
#include <iostream>
#include <vector>
#include <random>
enum Halfspace {N, P};
typedef double T;
class VectorWrongSizeException : public std::exception {
const char* what() const noexcept override {
@EmmanuelMess
EmmanuelMess / main.cpp
Last active August 20, 2018 22:49
Competitive unsupervised learning without Oja's algorithm
#include <iostream>
#include <vector>
#include <random>
typedef double T;
class VectorWrongSizeException : public std::exception {
const char* what() const noexcept override {
return "Different vector sizes!";
}
@EmmanuelMess
EmmanuelMess / main.cpp
Created September 4, 2018 23:03
Competitive unsuperviced learning of MINST w/Oja's algorithm (18.45% error)
#include <iostream>
#include <vector>
#include <cmath>
#include <random>
#include <csetjmp>
#include "mnist/mnist_reader.hpp"
using namespace std;
@EmmanuelMess
EmmanuelMess / DensityPixelsUtils.kt
Created October 1, 2018 14:45
Intuitive Dp to Px and Px to Dp converter in kotlin
import android.content.res.Resources
val Int.px: Pixels
get() = Pixels(this.toFloat())
val Int.dp: DensityPixels
get() = DensityPixels(this.toFloat())
/*inline*/ class Pixels(val value: Float) {
@EmmanuelMess
EmmanuelMess / calculator.kt
Last active October 28, 2018 00:34
A calculator using shunting yard and inverse polish (aka postfix) notation
import java.math.BigInteger
import java.util.*
import kotlin.IllegalArgumentException
sealed class Values(value: Any) {
data class Boolean(val value: kotlin.Boolean): Values(value) {
override fun toString() = value.toString()
}
data class Decimal(val value: BigInteger): Values(value) {
override fun toString() = value.toString()
@EmmanuelMess
EmmanuelMess / NASM-MIPS.md
Last active September 16, 2020 21:16 — forked from t-mullen/NASM-MIPS.md
Fixed titles