Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@iyedb
iyedb / Dockerfile
Last active April 28, 2017 20:29
A Dockerfile with tensorflow-latest gpu and python3
FROM gcr.io/tensorflow/tensorflow:latest-devel-gpu-py3
RUN pip3 install keras pillow opencv-python h5py \
python-socketio flask eventlet graphviz pydot-ng
class Cache(object):
def __init__(self, seq, size, latency):
self.size = size
self.seq = seq
self.latency = latency
def put(self, video):
if self.size >= video:
self.size -= video
return True
@iyedb
iyedb / luaembed
Created September 29, 2014 23:04
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
@iyedb
iyedb / remote_sort.sh
Created March 16, 2014 13:29
sort files on remote host(s)
#!/bin/bash
REMOTE_HOST=freelaptop
if [ -d sortedfiles ]
then
rm -rf ./sortedfiles/*
else
tempdir=$(mktemp -d sortedfiles)
fi
if [ -f ./res ]
@iyedb
iyedb / ce.bash
Last active August 29, 2015 13:57
A small bash script to compile and execute one file C++ programs
#!/bin/bash
#./ce.sh filename.cxx|cpp args...
CC="c++ -std=c++11 -o"
src_name=$1
exe_name=${src_name%.c[px]*}
if [ -f "$exe_name" ]
then
echo "delete $exe_name"
@iyedb
iyedb / nqueens.cxx
Created March 2, 2014 00:39
N Queens solution implementation in C++
#include <iostream>
#include <vector>
#include <sstream>
#include <set>
#include <cmath>
std::set<std::vector<int>> solve(int n)
{
brew doctor
Warning: /usr/local/share/python is not needed in PATH.
Formerly homebrew put Python scripts you installed via `pip` or `pip3`
(or `easy_install`) into that directory above but now it can be removed
from your PATH variable.
Python scripts will now install into /usr/local/bin.
You can delete anything, except 'Extras', from the /usr/local/share/python
(and /usr/local/share/python3) dir and install affected Python packages
anew with `pip install --upgrade`.