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
require 'open3' | |
#------------------------------------------------------------------------------- | |
LOG_FILE = 'inputlog.log' | |
#------------------------------------------------------------------------------- | |
# Androidでの入力のログファイルへの出力 | |
#------------------------------------------------------------------------------- | |
def recordToLogFile | |
Open3.popen3('adb shell') do |stdin,stdout,stderr,thread| |
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
コマンド | |
■Android Shell | |
●Android アプリ名からプロセスを探してKill(ただし、UNIXシェルから実行。WindowsからならMinGWとか使う) | |
adb shell ps|grep <プロセス名> |awk '{ print $2 }' | xargs adb shell kill | |
●圧縮ファイル解凍 | |
busybox unzip -x <圧縮ファイル名>.zip | |
■Linux |
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
# -*- coding: CP932 -*- | |
# コメントの削除 | |
import re | |
import codecs | |
import csv | |
import os | |
import string | |
DIR_NAME = r"D:\src" | |
MOD_DIR_NAME = r"D:\dest" |
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
# -*- coding: CP932 -*- | |
# 指定フォルダ以下の指定拡張子のファイルリストを表示 | |
import re | |
import os | |
def main(): | |
print os.path.realpath(".") | |
for root, dirs, files in os.walk(r"D:¥work¥src"): | |
for fname in files: | |
if( fname[-4:] == ".cpp" ) or ( fname[-2:] == ".c" ) or ( fname[-2:] == ".h" ): |
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
@Override | |
protected void onNewIntent(Intent intent) { | |
// NDEF exchange mode | |
if (!mWriteMode && NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction())) { | |
NdefMessage[] msgs = getNdefMessages(intent); | |
} | |
// Tag writing mode | |
if (mWriteMode && NfcAdapter.ACTION_TAG_DISCOVERED.equals(intent.getAction())) { | |
Tag detectedTag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG); |
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
@Override | |
protected void onNewIntent(Intent intent) { | |
// NDEF exchange mode | |
if (!mWriteMode && NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction())) { | |
NdefMessage[] msgs = getNdefMessages(intent); | |
promptForContent(msgs[0]); | |
} | |
// Tag writing mode | |
if (mWriteMode && NfcAdapter.ACTION_TAG_DISCOVERED.equals(intent.getAction())) { |
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
@Override | |
protected void onNewIntent(Intent intent) { | |
// NDEF exchange mode | |
if (!mWriteMode && NfcAdapter.ACTION_NDEF_DISCOVERED.equals(intent.getAction())) { | |
NdefMessage[] msgs = getNdefMessages(intent); | |
promptForContent(msgs[0]); | |
} | |
// Tag writing mode | |
if (mWriteMode && NfcAdapter.ACTION_TAG_DISCOVERED.equals(intent.getAction())) { |
NewerOlder