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
; http://www.autoitscript.com/forum/topic/139953-msgbox-with-scrollbar/#entry982510 | |
#include <APIConstants.au3> | |
#include <GUIConstantsEx.au3> | |
#include <WinAPIEx.au3> ; www.autoitscript.com/forum/topic/98712-winapiex-udf/ | |
Example() | |
Func Example() | |
Local $hGUI = _GUICreate_NoIcon("_GUICreate_NoIcon()") |
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
; URL http://stackoverflow.com/a/11270659/720077 | |
; made by ascend4nt (https://sites.google.com/site/ascend4ntscode/processfunctions) | |
#include <WinAPI.au3> | |
#include <Misc.au3> | |
Func _WindowFromPoint($iX,$iY) | |
Local $stInt64,$aRet,$stPoint=DllStructCreate("long;long") | |
DllStructSetData($stPoint,1,$iX) | |
DllStructSetData($stPoint,2,$iY) |
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
; Original thread: http://www.autoitscript.com/forum/topic/146661-hwid-protect-your-script/ | |
Func _HWID() | |
local $drives = DriveGetDrive("FIXED") | |
local $space = 0 | |
local $serial = "" | |
local $RAM = MemGetStats() | |
for $i=1 to $drives[0] | |
$space += DriveSpaceTotal ($drives[$i]) | |
$serial &= StringUpper(DriveGetSerial($drives[$i])) |
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
# See: http://docs.python.org/2/library/stdtypes.html | |
>>> "alma" or "korte" | |
Out[1]: 'alma' | |
>>> "" or "barack" | |
Out[2]: 'barack' |
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
#http://stackoverflow.com/questions/265960/best-way-to-strip-punctuation-from-a-string-in-python | |
import re, string | |
table = string.maketrans("","") | |
regex = re.compile('[%s]' % re.escape(string.punctuation)) | |
def test_re(s): # From Vinko's solution, with fix. | |
return regex.sub('', s) | |
def test_trans(s): |
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
# http://stackoverflow.com/questions/2257441/python-random-string-generation-with-upper-case-letters-and-digits/2257449#2257449 | |
def id_generator(size=6, chars=string.ascii_uppercase + string.digits): | |
return ''.join(random.choice(chars) for x in range(size)) |
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
from PyQt4.QtGui import QTableWidgetItem | |
from PyQt4.QtCore import Qt | |
class TableWidgetCenteredItem(QTableWidgetItem): | |
""" Read only centered cells in QTableWidget. """ | |
def __init__(self, *args, **kwargs): | |
super(TableWidgetCenteredItem, self).__init__(*args, **kwargs) | |
self.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter) | |
self.setFlags(Qt.ItemIsEnabled | Qt.ItemIsSelectable) |
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 requests | |
r = requests.get("http://download.thinkbroadband.com/10MB.zip", | |
cookies={'cookie1': 'working'} | |
) | |
open('10MB.zip', 'wb').write(r.content) |
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
# http://stackoverflow.com/a/300533/720077 | |
import urllib2 | |
file_name = urllib2.unquote(url).decode('utf8').split('/')[-1] |