投稿

12月, 2013の投稿を表示しています

DebianでBluetoothスピーカーを使う

Bluezを導入して、Bluetoothスピーカーを鳴らす。 ※これはBlueZ4のときなので、 BlueZ5はこっち に書いておく   # apt-get install bluez python-gobject スクリプトを修正しないとエラーが出るので 『OBDNマガジン』様の言う通り に修正 bluez-simple-agentのスクリプト修正 capability = "DisplayYesNo" Bluetooth機器の設定 # hcitool scan Scanning ... XX:XX:XX:XX:XX:XX BT-SPEAKER # bluez-simple-agent hci0 XX:XX:XX:XX:XX:XX RequestPinCode (/org/bluez/nnnn/hci0/dev_XX_XX_XX_XX_XX_XX) Enter PIN Code: 0000 Release New device (/org/bluez/nnnn/hci0/dev_XX_XX_XX_XX_XX_XX) # bluez-test-device list XX:XX:XX:XX:XX:XX BT-Headset XX:XX:XX:XX:XX:XX Nexus 7 XX:XX:XX:XX:XX:XX BT-SPEAKER Bluez-audioのインストール # apt-get install bluez-audio bluez-utils Bluetoothサウンド設定 pcm.bluetooth { type bluetooth device "XX:XX:XX:XX:XX:XX" profile "auto" } Bluetoothサービス再起動 # /etc/init.d/bluetooth restart じゃあ、再生! # mplayer -ao alsa:device=bluetooth sample.mp3 ふんどしの持ち主 OBDNマガジン

XMLを貼り付ける場合

SyntaxHighlighterを使って、XMLを貼り付ける場合に、折り返しがおかしくなってしまう場合。 XMLを ここをお借りしてエンティティ変換 してから貼り付ける。 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:padding="10dp" > <ImageView android:id="@+id/imageView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginRight="20dp" android:contentDescription="@string/image_description" android:src="@drawable/bake" /> <TextView android:id="@+id/textView1" android:layout_width="wrap_c

SyntaxHighlighter

SyntaxHighlighterはなくなったみたいです。。。たぶん。。。  なので、 highlight.jsを使おう !  Java,Xml,Shellをハイライト表示にする場合 テンプレートに以下のコードを埋め込む <link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css" rel="stylesheet" type="text/css"></link> <link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeMidnight.css" rel="stylesheet" type="text/css"></link> <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript"> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/> <script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js' type='text/javascript'/> <script language='javascript' type='text/javascript&