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
# Segmentation modes | |
OSD = 0 # OSD only | |
AUTOMATIC_OSD = 1 # Automatic page segmentation with OSD | |
AUTOMATIC_NO_OSD = 2 # Automatic page segmentation, but no OSD, or OCR | |
DEFAULT = 3 # Fully automatic page segmentation, but no OSD. (Default) | |
BLOCK_VERTICAL_VARIABLE = 4 # Assume a single column of text of variable sizes. | |
BLOCK_VERTICAL_UNIFORM = 5 # Assume a single uniform block of vertically aligned text. | |
BLOCK_SINGLE = 6 # Assume a single uniform block of text. | |
SINGLE_LINE = 7 # Treat the image as a single text line. | |
SINGLE_WORD = 8 # Treat the image as a single word. |
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
#!/bin/bash | |
# This script is called by udev when you link a bluetooth device with your computer | |
# It's called to add or remove the device from pulseaudio | |
# | |
# | |
# Output to this file | |
LOGFILE="/var/log/bluetooth_dev" | |
# Name of the local sink in this computer |
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
def p_decorate(func): | |
def func_wrapper(name): | |
return "<p>{0}</p>".format(func(name)) | |
return func_wrapper | |
@p_decorate | |
def get_text(name): | |
return "lorem ipsum, {0} dolor sit amet".format(name) | |
print get_text("Vipul") |
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
# borrowed this example from http://thecodeship.com/patterns/guide-to-python-function-decorators/ | |
def get_text(name): | |
return "lorem ipsum, {0} dolor sit amet".format(name) | |
def p_decorate(func): | |
def func_wrapper(name): | |
return "<p>{0}</p>".format(func(name)) | |
return func_wrapper | |
my_get_text = p_decorate(get_text) |
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
def wrapper(): | |
wrapper_a = 10 | |
def inner(): | |
print wrapper_a | |
return inner | |
wrapper() | |
""" | |
Output: | |
10 |
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
>>> a = 10 | |
>>> a.__class__ | |
<type 'int'> | |
>>> | |
>>> | |
>>> '10'.__class__ | |
<type 'str'> | |
>>> | |
>>> | |
>>>True.__class__ |
NewerOlder