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
with open('abc.txt', mode) as f: | |
f.write('abc') |
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
with open('abc.txt', mode) as f: | |
print(f.read()) |
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
with open('abc.txt', mode) as f: | |
print(f.tell()) |
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
open('abc.txt', mode) |
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
@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 |
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
@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 があるディレクトリ |
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 | |
# | |
# 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` |
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
# Hide mouse cursor | |
widget.setCursor(Qt.BlankCursor) | |
# Show mouse cursor (parent's cursor is used) | |
widget.unsetCursor() |
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
PreferenceManager | |
.getDefaultSharedPreferences(ctx) | |
.edit() | |
.clear() | |
.commit(); | |
PreferenceManager.setDefaultValues(ctx, R.xml.preferences, true); |
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
private void restartThis() { | |
finish(); | |
overridePendingTransition(0, 0); | |
startActivity(getIntent()); | |
overridePendingTransition(0, 0); | |
} |