This file contains 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
#Returns the md5 hash for every file in folder 'folder', except if the | |
#file is named 'md5' (because that means the folder already contains a md5 | |
#hash) | |
def md5_for_folder(self,folder, block_size=128): | |
md5 = hashlib.md5() | |
for root, dirs, files in os.walk(os.path.join(folder)): | |
for f in files: | |
if f!="md5": | |
fp = open(os.path.join(folder,f),'r') |
This file contains 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
import subprocess | |
def burn_data(self,PATH): | |
dir,file = (os.path.split(PATH)) | |
#unmount disc just in case (shouldn't be necessary for a blank disk) | |
p0 = Popen(["umount","/media/CDROM"],stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
#wait for unmount | |
p0.wait() | |
#create the isofs raw image to write to cd | |
p1 = Popen(["mkisofs","-R","-o","image.raw",PATH],stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
This file contains 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
barcode -b 0401001702201100 -e 128 -u mm -g 50x20 -o teste |
This file contains 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
svn propset svn:keywords 'Id Revision' target-source-file |
This file contains 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
#define VERSION "1.2.0 - development - COMMIT: $Revision: 17 $" |
This file contains 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
// sharpen image using "unsharp mask" algorithm | |
Mat blurred; double sigma = 1, threshold = 5, amount = 1; | |
GaussianBlur(img, blurred, Size(), sigma, sigma); | |
Mat lowConstrastMask = abs(img - blurred) < threshold; | |
Mat sharpened = img*(1+amount) + blurred*(-amount); | |
img.copyTo(sharpened, lowContrastMask); |
This file contains 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
std::vector<cv::Mat> planes; | |
cv::cvtColor(mat, sharp_mat, CV_BGR2HSV); | |
cv::split(sharp_mat, planes); | |
cv::equalizeHist(planes[2], planes[2]); | |
cv::merge(planes, sharp_mat); | |
cv::cvtColor(sharp_mat, mat, CV_HSV2BGR); |
This file contains 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
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
sm = (SensorManager) getSystemService(SENSOR_SERVICE); | |
accell = sm.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); | |
setContentView(R.layout.activity_main); | |
xacc = (TextView) findViewById(R.id.xvalue); | |
yacc = (TextView) findViewById(R.id.yvalue); | |
zacc = (TextView) findViewById(R.id.zvalue); | |
This file contains 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
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
s.connect(("gmail.com",80)) | |
print(s.getsockname()[0]) | |
s.close() |
This file contains 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
###################################################################### | |
## | |
## Feature Broker | |
## | |
###################################################################### | |
class FeatureBroker: | |
def __init__(self, allowReplace=False): | |
self.providers = {} | |
self.allowReplace = allowReplace |
OlderNewer