View write.py
with open('abc.txt', mode) as f: | |
f.write('abc') |
View read.py
with open('abc.txt', mode) as f: | |
print(f.read()) |
View tell.py
with open('abc.txt', mode) as f: | |
print(f.tell()) |
View open.py
open('abc.txt', mode) |
View env.bat
@REM Qt5 + MinGW でコンパイルできる環境を作るバッチ | |
@REM === ENV === | |
SET MINGWBIN=c:\mingw64\bin | |
SET PERLBIN=C:\strawberry\perl\bin | |
SET PYTHONBIN=c:\python27 | |
SET RUBYBIN=C:\Ruby200-x64\bin | |
SET GITBIN=C:\mingw64\msys\bin | |
SET QTREPO=C:\Qt\qt5 |
View qt5build.bat
@REM MinGW64 で Qt5 をコンパイルするためのバッチ | |
@REM 参考) MinGW 64 bit | Qt Wiki | Qt Project http://qt-project.org/wiki/MinGW-64-bit | |
@REM | |
@REM [使い方] | |
@REM あらかじめ、OpenSSL, ICU をビルドし、インストールしておく事 | |
@REM 以下の環境変数の値を === ENV === の欄で適切に設定する | |
@REM MINGWBIN MinGW の bin ディレクトリ (コンパイラがあるディレクトリ) | |
@REM PERLBIN perl.exe があるディレクトリ | |
@REM PYTHONBIN python.exe があるディレクトリ | |
@REM RUBYBIN ruby.exe があるディレクトリ |
View gist:7288407
#!/bin/bash | |
# | |
# Brightness script for the ASUS G74SX | |
# | |
# Arguments: | |
# up - increase brightness by 1 | |
# down - decrease brightness by 1 | |
# | |
BRIGHTNESS=`cat /sys/devices/platform/asus-nb-wmi/leds/asus\:\:kbd_backlight/brightness` |
View gist:5599293
# Hide mouse cursor | |
widget.setCursor(Qt.BlankCursor) | |
# Show mouse cursor (parent's cursor is used) | |
widget.unsetCursor() |
View gist:5074821
PreferenceManager | |
.getDefaultSharedPreferences(ctx) | |
.edit() | |
.clear() | |
.commit(); | |
PreferenceManager.setDefaultValues(ctx, R.xml.preferences, true); |
View gist:5074217
private void restartThis() { | |
finish(); | |
overridePendingTransition(0, 0); | |
startActivity(getIntent()); | |
overridePendingTransition(0, 0); | |
} |