Symfony1.4でRSS Feedを取得 and SwiftMailerでメール送信(gmail)

sfFeed2Pluginをインストールします。 # symfony plugin:install sfFeed2Plugin # symfony ccあとは簡単。RSSフィードをsfFeed2を使って取得します。 $feed = sfFeedPeer::createFromWeb('http://feed/rss.xml'); foreach( $feed->getItems() as $item) { /*…

Symfony1.4で認証機能をつける

Doctrineを利用している場合。 # symfony generate:project frontend # symfony generate:app myApp # symfony plugin:install sfDoctrineGuardPlugin # symfony doctrine:build --all --and-load --no-confirmation # symfony ccapps/myApp/config/security…

symfonyをpearから利用する

# pear upgrade PEAR # pear channel-discover pear.symfony-project.com # pear install symfony/symfonypearはapt-getなどで入れてください。あとは # symfony -V # symfony generate:project myApp # symfony generate:app helloWorld # symfony generate…

買って間違い無し。Macの鉄板ソフト。

Coda (開発用) http://www.panic.com/jp/coda/ Subversionにも対応しています。 Transmit (データ転送用 FTP/SFTP) http://www.panic.com/jp/transmit/ 速度抜群。FTP,SFTPでだいたい何でも転送できます。 Xcode4 (Apple製品開発用) http://developer.apple.…

NSURL, NSURLRequest, NSURLConnectionの基本

- (void)main { NSURL * url = [[NSURL alloc] initWithString:@"http://www.yahoo.co.jp"]; NSURLRequest * req = [[NSURLRequest alloc] initWithURL:url]; NSURLConnection * conn = [[NSURLConnection alloc] initWithRequest:req delegate:self]; if(co…

UIApplicationのプロパティ

UIApplicationのプロパティ一覧 // ステータスバーを隠す [UIApplication sharedApplication].statusBarHidden = YES; // スリープ・アイドルしないようにする [UIApplication sharedApplication].idleTimerDisabled = YES; // アプリケーションのバッジ数字…

シンセプリセット:中田ヤスタカプリセット Capsule Eternity

DTM

私と同じ金沢出身の中田ヤスタカはデジタルシンセで有名なNative Instrumentsのプリセットを多用していることがよく知られている。NIのMassiveやPro-53のプリセットをよく耳にしたりする。音色一つ一つを作っていってこそ面白いという時代ではないのは明らか…

UIImageにURLからイメージを読み込ませる

NSURLからNSDataにデータを入れてそのままUIImageに投げればいいだけです。 簡単ですが忘れがち。非同期にするにはちょっと工夫がいりますね。ここでは実装してません。 UIImageView * imageView = [[UIImageView alloc]init]; NSURL *url = [NSURL URLWithS…

touchesBeganなどUIResponderのメソッドをdelegateする

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event; - (void)touchesMoved: (NSSet *)touches withEvent:(UIEvent *)event; - (void)touchesEnded: (NSSet *)touches withEvent:(UIEvent *)event; - (void)touchesCancelled:(NSSet *)touch…

NSTimerとuserInfoの使い方。

よく使うのにたまに忘れがちなのでNSTimerの使い方かきました。userInfoの使い方とか参考になれば。 http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSTimer_Class/Reference/NSTimer.html#//apple_ref/doc/uid…

iOS(iPhone/iPad)アプリケーション公開申請までの流れ(Xcode4)

iOS(iPhone/iPad)アプリケーション公開申請までの流れをなるべく分かりやすく確認できるように工夫して書きました。application1.xcodeprojというプロジェクトで開発を進めたということで話を進めています。プロジェクト名が違う場合は置き換えてください。 …

AVAudioPlayerでfadein/fadeout(フェードイン・フェードアウト)を実装したライブラリ

AVAudioPlayerを使ったライブラリを作りました。AVAudioPlayerの実例が少なかったからしっかりとまとめた。AudioQueueとかAudioUnitじゃないとできないんじゃないの?ということがAVAudioPlayerでできます。 AudioPlayerDelegateをdelegateして使いたいクラ…

AVAudioPlayerを使った音楽ファイルの再生

AVAudioPlayerを使って音楽を再生する方法です。再生時間をNSTimerを使って表示しています。NSRunLoopでも表示は可能かと思いますがNSTimerのほうがはるかに楽です。githubにもございます。 GitHub - kmusiclife/AudioPlayer: This is AudioPlayer class ext…

NSArray, NSMutableArrayをランダムに置き換える

- (NSMutableArray *)randomizedArray:(NSMutableArray *)filename{ srand([[NSDate date] timeIntervalSinceReferenceDate]); int i = [filenames count]; while(--i) { int j = rand() % (i+1); [filenames exchangeObjectAtIndex:i withObjectAtIndex:j];…

UIViewでよく使うのに覚えきれないメモ

UIViewContentMode typedef enum { UIViewContentModeScaleToFill, // これがデフォルト。UIImageViewにめいっぱいひろげる UIViewContentModeScaleAspectFit, // 画像のaspect比を維持し、ちょうどはいるようにする UIViewContentModeScaleAspectFill, // …

UIViewでUITouchを使って右フリック・左フリック・上フリック・下フリックを検出する

UIViewControllerを利用した上で右フリック・左フリック・上フリック・下フリックを検出する方法です。UIViewControllerのdelegateで実装される -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event -(void)touchesEnded:(NSSet *)touches wit…

UITabBarNavigationにUINavigationController+UITableViewControllerとUIViewControllerを同時に使う

長いタイトルですがタイトルの通りです。UITabBarNavigationにUINavigationController+UITableViewControllerとUIViewControllerを同時に使う。意外とややこしかったのでテンプレでまとめておきました。結構使うのにサンプルが少なかったりします。結局こう…

Objective-CでのTips UITableViewControllerのimplements

UITableViewControllerのimplementsを忘れるのでメモついでに。 #import "MyClass.h" @implementation MyClass @synthesize items; // 独自の拡張メソッド -(id) initWithTableObject:(UITableViewController *)tableView{ items = [[NSMutableArray alloc]i…

Objective-CのTips tableViewを動的に追加する

tableViewに動的に一行を追加する おもった以上に迷いました。 /* NSMutableArray * items; @property (nonatomic, retain) NSMutableArray * items; @synthesize items; */ [self.tableView beginUpdates]; [items addObject:@"ADD CEL"]; NSIndexPath * pa…

RhacoでRSS Feedを作る。

Rhaco1.xで動いているアプリがいくつかあるのでメンテナンス。 Rssをrhaco1.xで吐き出す方法。意外と忘れます。 Rhaco::import('tag.feed.Rss20'); Rhaco::import('tag.feed.model.RssItem20'); $rss = new Rss20(); $rssItem = new RssItem20(); $rssItem->…

English Lesson 264 (murmur, even if, conserve, sufficient, sustain)

Deep in thought, the captain murmured, "Even if we conserve our food, it will only be sufficient to sustain us for two weeks at most." deep in thought 考え、思考 murmur(v.i) ブツブツつぶやく(陰でつぶやく, 不平, 不満) http://ja.forvo.com/wo…

English lesson 262 (efficiency, favorable)

Capitalism, as opposed to socialism or communism, is believed to have favorable effect on the economy in that in promotes efficiency through competition. favorable(adj) 意見などが好意的な favorable opinion of〜 as opposed to 〜とは対照的に…

English Lesson 263 (oblige, persist, reiterated)

Colonel Sanders looked me in the eye and said, "If you presist in ignoring my commands, I'll be ogliged to transfer you somewhere else." persist(v.i) し続けるto persist in sayingyou persist in ignoring my commands persist in doing〜 oblige…

Objective-CでのTips UIControllerなど

UINavigationControllerに関する忘れがちなメモ // UITableViewのCellをクリックしたときの動作 detailViewController * detail = [[detailViewController alloc]initWithNibName:@"detailViewController" bundle:nil]; // extends UITableView [self.naviga…

人がどこまででも成長するための3つ能力。

努力という言葉が嫌い。でも人からは努力家と言われる。努力は妄想なのではないかと思っています。努力をしているのではなく好きだからそれを深めることが出来るだけ。それを努力と言われても努力とは思わない。好きなだけだから。小学校中学校高校、そして…

jackd経由でarecordを使ってmp3ファイルで録音する方法

.asoundrcには下記のようにjackd with alsaデバイスを設定しておきます。 pcm.jackplug { type plug slave { pcm "jack" } } pcm.jack { type jack playback_ports { 0 alsa_pcm:playback_1 1 alsa_pcm:playback_2 } capture_ports { 0 alsa_pcm:capture_1 1…

Imagemagick(convert)でコマンドラインからまとめてサムネイルを作る方法

for image in `ls *.jpg`; do convert -sample 10%x10% $image thumbs/$image; done;例えばこれで縦横10%に縮小します。元画像をサムネイルしてthumbsフォルダにサムネイルを作成します。convertオプション一覧(日本語) http://www5a.biglobe.ne.jp/~nkgwtty…

phpでショートでユニークなIDを作る方法。youtubeのIDのようなIDを作る方法。

function gen_uuid($len=8) { $hex = md5("your_random_salt_here_31415" . uniqid("", true)); $pack = pack('H*', $hex); $uid = base64_encode($pack); // max 22 chars $uid = ereg_replace("[^A-Za-z0-9]", "", $uid); // mixed case //$uid = ereg_rep…

EC-CUBEで商品一覧をDBから独自に抜き出す方法

独自に商品一覧をec-cubeから抜き出す方法です。 $objQuery = new SC_Query(); $cols = array( 'product_id', 'product_code_min', 'product_code_max', 'name', 'comment1', 'comment2', 'comment3', 'main_list_comment', 'main_image', 'main_list_image'…

Demand Mediaというコンテンツファーム

http://ascii.jp/elem/000/000/584/584967/ Demand Media は独自の予測アルゴリズム技術を用いてオンラインユーザが求めている情報を解析して、それに合致する記事やビデオなどのコンテンツをeHowや Livestrong、Trails.com、answerbag などのDemand Mediaネ…