2013-10-01から1ヶ月間の記事一覧

Node.jsでコンソールコマンドを実行する

http://yume-build.com/blog/archives/117

AppleScriptでiTunesを操作する

http://dougscripts.com/itunes/itinfo/info01.php

複数ファイルの改行コードを一括で置換する

Vimのsetfileformatでちまちまやってたけど、このスニペットが便利だった。 http://qiita.com/kouchi67/items/958e74ef792eed0c157d find . -type f | xargs -n 10 nkf -Lu --overwrite

wxPythonのインストール

安定版のCarbon APIを使用した方は32bitにしか対応していないらしい。 Development版Cocoa APIの方を使う。http://sourceforge.net/projects/wxpython/files/wxPython/2.9.5.0/wxPython2.9-osx-2.9.5.0-cocoa-py2.7.dmg/download?use_mirror=jaist

BeautifulSoupとwgetを組み合わせた自動ダウンロードスクリプト

#! /usr/bin/env python # -*- coding:utf-8 -*- from bs4 import BeautifulSoup import urllib2 import os url = "http://caseyscaverns.com/4/halloween5.html" html = urllib2.urlopen(url).read() soup = BeautifulSoup(html) contents = soup.findAll("…

秋月のトライアック調光器キット

組み立て方がここに書いてあった。 http://www.sekailab.com/wp/2013/06/24/assemble-triac-tuner-kit/

Replicatorのラフトにモデルが張り付かない問題

ダミーの円柱を配置してラフトを強制的に広げるハックを教えてもらった。 でもうまくいかなかったので、結局モデルに台座をつけた。

ArduinoでUSBを使う

ここを参考に。 https://github.com/felis/USB_Host_Shield_2.0/tree/master/examples/testusbhostFAT $ cd /Applications/Arduino.app/Contents/Resources/Java/libraries $ git clone --recursive https://github.com/felis/USB_Host_Shield_2.0 $ git sub…

Arduinoと3Dプリンタで猫のおもちゃをつくる

Arduinoのコード #include <stdint.h> #include <avr/interrupt.h> #include <avr/io.h> #include <avr/pgmspace.h> #define SAMPLE_RATE 8000 #include "sounddata.h" int ledPin = 13; int speakerPin = 11; // Can be either 3 or 11, two PWM outputs connected to Timer 2 int tiltPin = 3; volatile uint16_t</avr/pgmspace.h></avr/io.h></avr/interrupt.h></stdint.h>…

FabmoduleでModelaを使う際のパラメータ

ミリング エンドミルは0.3mmを使う。銅箔の厚みのソース http://jp.rs-online.com/web/p/plain-copper-ink-resist-boards/4538723/ ドリリング エンドミルは0.8mmを使う。

MIDIのフォーマット

ここが参考になる。 http://www2s.biglobe.ne.jp/~yyagi/material/smfspec.html#deltatime MIDIキーボードを拾ってみた。 ド・ミ・ソ 90 noteON 34 note 55 vel 37 note 55 vel 30 note 55 vel 30 note 0 vel 34 note 0 vel 37 note 0 vel うまくいっていな…

マイコンでスイッチを使うとき

RubyのShoesでGUIプログラミング

おもしろい。 Shoes.app do flow margin: 12 do # Set up three buttons @one = button "One" @two = button "Two" @three = button "Three" # Bounce the second button @one.click do |button| alert "You are No.1!" end @two.click do |button| alert "T…

rubyでTwitterのメンションを待ち受ける

require 'tweetstream' TweetStream.configure do |config| config.consumer_key = 'xxx' config.consumer_secret = 'xxx' config.oauth_token = 'xxx' config.oauth_token_secret = 'xxx' config.auth_method = :oauth end client = TweetStream::Client.ne…

emacsで選択部分をコメントアウトする

リージョンを選択してから M - ; (メタキー+セミコロン)でできる。

Raspberry piを無線LANのアクセスポイントにする

Linuxで動きそうなUSBアンテナを探す http://d.hatena.ne.jp/nayutaya/20120825/1345877309これとか Amazonだともう売ってない http://www.amazon.co.jp/exec/obidos/ASIN/B00439HZ3Y/nayutaya04-22/ref=nosimヨドバシで買えそう http://www.yodobashi.com/e…

Fab-Fiのレーザーカットファイル

http://fabfi.fabfolk.com/distribution/

Arduinoから猫の鳴き声を出力する

1.猫の鳴き声を落としてくる(wavファイル) http://www.kessels.com/catsounds/ 2.AudacityでWAVを開きリサンプリングしてWAVにExportする リサンプリング要求はMono、8bit PCM(unsigned)、8000Hz、音源は3秒間以下(※) ※8kHz x 4秒 = 32k Byte(一音を1バ…