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())) { |
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 <CoreMotion/CoreMotion.h> | |
-(void) initMotionManager{ | |
// 1.CMMotionManagereより、端末の姿勢情報を取得 | |
_motionManager = [[CMMotionManager alloc] init]; | |
// 更新の間隔を設定する | |
_motionManager.deviceMotionUpdateInterval = 1.0f / 30.0f; | |
// ハンドラを設定する | |
CMDeviceMotionHandler deviceMotionHandler; |
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
- (void) doMonitoring{ | |
// Δφ0(t)=-gi/K*Δφ1(t)+gf*Δφ0(t-1) | |
const float gi = 0.5f; | |
const float gf = 1.4f; | |
const float Kinv = 10.0f; | |
const float MAX_VOL = 2.0f; //角速度最大値 | |
// 現在の角度 | |
btScalar angle = pHinge->getHingeAngle(); |
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
reg [17:0] voltage; | |
reg [16:0] timer; | |
always @(posedge ADC_CLK) | |
case (state) | |
0 : begin // sense ----------------------------------- | |
if (ADC_DAT == 1) | |
begin | |
if ($signed(voltage) < $signed(18'h1FFFF)) | |
voltage <= voltage + 1; // if not saturated | |
end |
NewerOlder