probe -u root
set timeout=10
set default=0
menuentry "Run Ubuntu Live ISO" {
set isofile=/ISO/ubuntu-16.04-desktop-amd64.iso
loopback loop ${isofile}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Written by Aaron Cohen -- 1/14/2013 | |
# Brought to you by BitTorrent, Inc. | |
# "We're not just two guys in a basement in Sweden." TM | |
# | |
# This work is licensed under a Creative Commons Attribution 3.0 Unported License. | |
# See: http://creativecommons.org/licenses/by/3.0/ | |
import sys | |
import re | |
import socket |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from subprocess import Popen, PIPE | |
from time import sleep | |
# run the shell as a subprocess: | |
p = Popen(['python', 'shell.py'], | |
stdin = PIPE, stdout = PIPE, stderr = PIPE, shell = False) | |
# issue command: | |
p.stdin.write('command\n') | |
# let the shell output the result: | |
sleep(0.1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "mser.hpp" | |
#include <opencv2/imgcodecs.hpp> | |
#include <opencv2/highgui.hpp> | |
#include <vector> | |
#include <iostream> | |
using namespace std; | |
using namespace cv; | |
vector<Point> selectPoints(const String &video_name, const Mat &frame) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get install isc-dhcp-server -y | |
set interfaces | |
set addresses | |
set ip | |
# Find network interfaces | |
function find_interfaces() | |
{ | |
local ip_result=$(ip link | awk '{print $2}') | |
ip_result=($ip_result) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from http://stackoverflow.com/questions/800383/what-is-the-difference-between-mutex-and-critical-section | |
// a performance testing between mutex and CRITICAL_SECTION on windows | |
HANDLE mutex = CreateMutex(NULL, FALSE, NULL); | |
CRITICAL_SECTION critSec; | |
InitializeCriticalSection(&critSec); | |
LARGE_INTEGER freq; | |
QueryPerformanceFrequency(&freq); | |
LARGE_INTEGER start, end; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from mathfuncs_core.cpp of opencv | |
void fastAtan2(const float *Y, const float *X, float *angle, int len, bool angleInDegrees ) | |
{ | |
int i = 0; | |
float scale = angleInDegrees ? 1 : (float)(CV_PI/180); | |
for( ; i < len; i++ ) | |
{ | |
float x = X[i], y = Y[i]; | |
float ax = std::abs(x), ay = std::abs(y); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "resolver", | |
"ns": "nonymous", | |
"author": "gyl", | |
"prefix": "batch downloader for wiley ebooks", | |
"match": "^http://onlinelibrary\\.wiley\\.com/.*/pdf$", | |
"static": true, | |
"finder": "src=\"([^\"]*\\.pdf[^\"]*)\"", | |
"builder": "{1}" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "resolver", | |
"ns": "nonymous", | |
"author": "gyl", | |
"prefix": "batch downloader for International Press", | |
"match": "^http://intlpress\\.com/.*/body\\.html", | |
"static": true, | |
"finder": "href=\"(.+pdf)\"", | |
"builder": "{1}" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//sorting points by clockwise using cross product | |
//see <http://stackoverflow.com/questions/6989100/sort-points-in-clockwise-order> | |
bool less(point a, point b) | |
{ | |
if (a.x - center.x >= 0 && b.x - center.x < 0) | |
return true; | |
if (a.x - center.x < 0 && b.x - center.x >= 0) | |
return false; | |
if (a.x - center.x == 0 && b.x - center.x == 0) { | |
if (a.y - center.y >= 0 || b.y - center.y >= 0) |
NewerOlder