Skip to content

Instantly share code, notes, and snippets.

View ducalpha's full-sized avatar

Duc Bui ducalpha

View GitHub Profile
@ducalpha
ducalpha / tiling.py
Created January 22, 2017 12:25 — forked from datalyze-solutions/tiling.py
simple python window tiling script with wmctrl
#!/usr/bin/python
import time
start = time.time()
import os, sys
def setWindow(posX, posY, sizeX, sizeY):
values = {
'gravity': 0,
@ducalpha
ducalpha / point_of_max_overlap.cpp
Last active October 23, 2015 05:47 — forked from ducss2015/point_of_max_overlap.cpp
Find the point of max overlap, given a number of intervals
/*You are given large numbers of logs, each one of which contains a start time (long), end time (long) and memory usage (int). The time is recorded as MMDDHH (100317 means October 3rd 5PM) Write an algorithm that returns a specific time (hour) when the memory usage is the highest. If there are multiple answers, return the first hour.
*/
#include <cstdio>
#include <sstream>
#include <fstream>
#include <map>
#include <vector>
using namespace std;