Skip to content

Instantly share code, notes, and snippets.

🏠
Working on FOSS and AI

Emmanuel EmmanuelMess

🏠
Working on FOSS and AI
Block or report user

Report or block EmmanuelMess

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@EmmanuelMess
EmmanuelMess / calculator.kt
Last active Oct 28, 2018
A calculator using shunting yard and inverse polish (aka postfix) notation
View calculator.kt
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 / DensityPixelsUtils.kt
Created Oct 1, 2018
Intuitive Dp to Px and Px to Dp converter in kotlin
View DensityPixelsUtils.kt
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 / main.cpp
Created Sep 4, 2018
Competitive unsuperviced learning of MINST w/Oja's algorithm (18.45% error)
View main.cpp
#include <iostream>
#include <vector>
#include <cmath>
#include <random>
#include <csetjmp>
#include "mnist/mnist_reader.hpp"
using namespace std;
@EmmanuelMess
EmmanuelMess / main.cpp
Last active Aug 20, 2018
Competitive unsupervised learning without Oja's algorithm
View main.cpp
#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
Last active Jul 21, 2018
Perceptron learning algorithm with Pocket implementation with heuristic
View main.cpp
#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 Jul 13, 2018
Perceptron learning algorithm implementation with heuristic
View main.cpp
#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 Jul 12, 2018
Perceptron learning algorithm (the worst one) implementation with heuristic
View main.cpp
#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 / NASM-MIPS.md
Last active Mar 16, 2018 — forked from t-mullen/NASM-MIPS.md
Fixed titles
View NASM-MIPS.md
View FileNamesForLimitedCharacters.cpp
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <map>
#include <queue>
using namespace std;
struct TRIE {
@EmmanuelMess
EmmanuelMess / DialogPreferenceWithKeyboard.java
Last active Feb 18, 2017
DialogPreference that lets you use the keyboard
View DialogPreferenceWithKeyboard.java
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;
You can’t perform that action at this time.