Von einem Anfänger der in die Fotografie rein kommen will.
auch ST, der Bereich nach hinten (z-Achse) der scharf ist im Bild
| % clear workspace | |
| clear % erase variables from matlab workspace without saving | |
| clc % clear command window | |
| close all % close all figures windows wihtout saving | |
| bdclose all % close all simulink models without saving |
| """ | |
| by: Peter Norvig | |
| http://norvig.com/python-iaq.html | |
| """ | |
| def timer(fn, *args): | |
| "Time the application of fn to args. Return (result, seconds)." | |
| import time | |
| start = time.clock() | |
| return fn(*args), time.clock() - start |
| ; Remap Umlaute | |
| ; http://www.autohotkey.com/ | |
| ; 2015-04-21 | |
| SetCapsLockState AlwaysOff | |
| Capslock::RAlt | |
| >!+a:: | |
| Send, Ä | |
| Return | |
| >!+u:: | |
| Send, Ü |
| import datetime | |
| import math | |
| def round_up_minutes(dt=None, minute_factor=60): | |
| """ Round up the minutes of a datetime object to any minute factor | |
| dt : datetime.datetime object, default now. | |
| minute_factor : number to which closest factor the minutes will round up | |
| with minute_factor = 15 it would round up to the closest quarter hour (0, 15, 30, 45) | |
| with minute_factor = 60 it would always round up to the next full hour |
| [program:myconf] | |
| command=/root/to/my/folder/startup.py | |
| directory=/root/to/my/folder/ | |
| user=myusername |
| from __future__ import print_function | |
| import datetime | |
| from sqlalchemy import create_engine | |
| from sqlalchemy import Column, DateTime, Integer | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy.orm import sessionmaker | |
| # connect to an database: |
| """ | |
| found here: http://amiest-devblog.blogspot.de/2008/08/how-to-crop-images-with-opencv-in.html | |
| opencv: http://opencv.org/ | |
| """ | |
| cropped = cvCreateImage( cvSize(new_width, new_height), 8, 3) | |
| src_region = cvGetSubRect(image, opencv.cvRect(left, top, new_width, new_height) ) | |
| cvCopy(src_region, cropped) |
| def kwargs_test(**kwargs): | |
| print('search for keyword >foo<: {0}'.format(kwargs.get('foo') or 'nope...')) | |
| if __name__ == "__main__": | |
| kwargs_test(foo='success') | |
| kwargs_test(bar='you dont see this') |
| import json | |
| import datetime | |
| import decimal | |
| class MyJsonEncoder(json.JSONEncoder): | |
| """ JSON Encoder with serializer for dates and decimal numbers """ | |
| def default(self, obj): | |
| if isinstance(obj, datetime.datetime): | |
| return str(obj.isoformat()) | |
| elif isinstance(obj, datetime.time): |