Skip to content

Instantly share code, notes, and snippets.

View claudiouzelac's full-sized avatar
🎯
Focusing

claudiouzelac

🎯
Focusing
View GitHub Profile
/*
* The plugins used for this build.
*/
/*
* Provides the compile, test, jar, etc tasks
*/
apply plugin: 'java'
/*
* Generates the Eclipse project files.
@claudiouzelac
claudiouzelac / gist:011fb2283ebe4a622b3c
Last active August 29, 2015 14:02
General environment setup for Java7/8, SBT, Kafka, Akka, and Scala
sudo apt-get update
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
#This is fine for Zookeeper or Kafka
sudo apt-get install oracle-java7-installer
#We require this on our other servers
#sudo apt-get install oracle-java8-installer
@claudiouzelac
claudiouzelac / redis_setup
Last active August 29, 2015 14:02
Setup Redis
#Mount EBS volume
#Check drives
lsblk
sudo mkdir /data
sudo mount {device_name} /data
# Install Redis
apt-get update
apt-get upgrade
apt-get install redis-server
@claudiouzelac
claudiouzelac / amazon_api_install
Created June 13, 2014 19:56
Installation information for Python Amazon API information.
sudo apt-get install python-pip
sudo apt-get install git
sudo apt-get install python-lxml
sudo pip install python-dateutil
sudo pip install redis
sudo pip install git+https://github.com/yoavaviram/python-amazon-simple-product-api.git
from pyparsing import *
# By default, PyParsing treats \n as whitespace and ignores it
# In our grammer, \n is significant, so tell PyParsing not to ignore it
ParserElement.setDefaultWhitespaceChars(" \t")
def parse(input_string):
def convert_prop_to_dict(tokens):
"""Convert a list of field property tokens to a dict"""
prop_dict = {}

Keybase proof

I hereby claim:

  • I am bowlofstew on github.
  • I am stewart (https://keybase.io/stewart) on keybase.
  • I have a public key whose fingerprint is 156C 390E C672 CEF9 FDFE 3C71 843E 4EE7 7C5A EE67

To claim this, I am signing this object:

#include <utility>
#include <iostream>
struct void_
{
template<typename Stream>
friend Stream &operator<<(Stream &s, void_)
{
return s << "()";
}

If you don't care about the explanation, scroll down to find the code, it's 50 some odd lines and written by someone who doesn't know any better. You have been warned.

What it does

This is a very simple proof of concept jitting RPN calculator implemented in python. Basically, it takes the source code, tokenizes it via whitespace, and asks itself one simple question: am I looking at a number or not?

First, let's talk about the underlying program flow. Pretend that you are a shoe connoisseur with a tiny desk. You may only have two individual shoes on that desk at any one time, but should you ever purchase a new one or get harassed by an unruly shoe salesman without realizing that you have the power to say no (or even maybe?), you can always sweep aside one of the two shoes on the desk (the one on the right, because you're a lefty and you feel that the left side is always superior) onto the messy floor, put the other shoe on the right hand side, and then place your newly acquired shoe in

@claudiouzelac
claudiouzelac / echo.cxx
Last active August 29, 2015 14:11 — forked from koblas/echo.cxx
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <ev++.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <resolv.h>
#include <errno.h>
#include <list>
// c++ -std=c++11 -O3 sort.cpp ; ./a.out
// qsort: 674 ms
// std::sort: 1104 ms
#include <string.h>
#include <stdio.h>
#include <chrono>
#include <string>
#include <vector>
#include <iostream>