2011-01-01から1年間の記事一覧
symfony-all などというコマンドで下記で一括初期化。早くて便利です。 #! /bin/bash symfony doctrine:build --all --no-confirmation -t symfony doctrine:clean; symfony doctrine:build-model; symfony doctrine:build-form; symfony doctrine:data-load…
設定が非常にややこしいsendmailからqmail, postfix, exim4など多くの便利なMTAなどが登場しています。しかしながら、Google Appsでのメール利用など単純にMXレコードを書くだけで近年は安定したメール環境が手に入るようになり、自前でSMTPを立てることも無…
nginxはhttpサーバ本体でありCGIを動かすのはすべてfastcgiです。fastcgiのエンジンをデーモンで構えているとそれぞれのfastcgiサーバが落ちた時にwebサーバが生きていてもサービス提供不能となります。死活問題です。そのためにmonitで落ちないfastcgiサー…
movabletypeでカテゴリアーカイブ、月間アーカイブのリストのテンプレです。自分でまとめてなくてまた作ってしもうたのでメモしときます。月間アーカイブ: <mt:IfArchiveTypeEnabled archive_type="Monthly"> <div class="list-wrap"> <mt:ArchiveList archive_type="Monthly"> <mt:ArchiveListHeader> <h2>月別アーカイブ</h2> <div class="list"> <ul> </mt:ArchiveListHeader> <li></li></mt:archivelist></div></mt:ifarchivetypeenabled>
下記環境はdebian6です。debian5ではaptでspawn-fcgi, fcgiwrapパッケージは提供されていないのでソースなどからインストール必要があります。nginxでperl/CGIを動かしました。nginxではcgiを動かす構造そのものは持っていません。phpもphp-fastcgi使います…
fastcgiが一番ややこしかったのでメモしておきます。下記環境はdebian5です。環境はさくらVPS上のdebianです。 1.nginx, php5関係のインストール # apt-get update # apt-get upgrade # apt-get install nginx php5-cli php5-cgi php5-gd spawn-fcgidebian…
最近facebookを使っていて直感的な感覚ですがtwitterが勢いをなくした時のような感覚を感じています。 定説になっているコミュニティの限界がそろそろ来たのではないだろうか。SNSがどのように進化するかという話になるんだろうけどlinkedinしかfacebook以外…
他のMTで使っているのに忘れてしまって再度調べてしまったのでUploadDir http://labs.m-logic.jp/cat2/uploaddir/Mtos5.12でも動作しました。
最近買ったバッグがあまりにも素晴らしかったのでご紹介。 バッグの名前はKATA カタ デジタルバックパック KT DR-467i-BR 何がすごいって ・一眼レフカメラ2台(sigma16-200mm, sigma8-16mmつけたまま縦に) ・レンズ2本(55-200mm, 16-55mmの標準レンズ2本) ・…
symfonyでプロジェクトを作る際にhttaccessが意外とややこしく動作してるの?どうなの?という初心者の方多い気がします。 <VirtualHost 192.168.0.1:80> ServerName yourdomainname.com ServerAdmin your@mailaddress.com DocumentRoot /var/www/sitepath/web DirectoryIndex index.php <Directory /></directory></virtualhost>…
symfonyで行うたった一行で行うフォームvalidation。validationで必要なので結構使う一行のはずなのですが長いね。 $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));下記のように使います。 public function …
sfDoctrinePagerを使ってPagerを実装する方法です。Doctrine Queryの参考にもなるかな。 $q = Doctrine_Core::getTable('Article')->createQuery('a')->where('a.url like ?', '%comment%'); $this->pager = new sfDoctrinePager('Article', 5); $this->page…
http://techwave.jp/archives/51689743.html を見て色々と考えてみた。 現状のウェブサービスを課金という切り口からざっくりと考えてみた。 【ウェブサービスと生活】 有料サービスを契約しても利用しなかったり、満足の行かないサービスが非常に多かった。…
添付ファイルのメールを送信しています。 $message = $this->getMailer()->compose( 'from@example.com', 'to@example.com', 'Subject is here.', 'Body is here.' )->attach( Swift_Attachment::fromPath('/var/www/tmp/image.jpg') ); $this->getMailer()-…
sfFeed2Pluginをインストールします。 # symfony plugin:install sfFeed2Plugin # symfony ccあとは簡単。RSSフィードをsfFeed2を使って取得します。 $feed = sfFeedPeer::createFromWeb('http://feed/rss.xml'); foreach( $feed->getItems() as $item) { /*…
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…
# 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…
Coda (開発用) http://www.panic.com/jp/coda/ Subversionにも対応しています。 Transmit (データ転送用 FTP/SFTP) http://www.panic.com/jp/transmit/ 速度抜群。FTP,SFTPでだいたい何でも転送できます。 Xcode4 (Apple製品開発用) http://developer.apple.…
- (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 sharedApplication].statusBarHidden = YES; // スリープ・アイドルしないようにする [UIApplication sharedApplication].idleTimerDisabled = YES; // アプリケーションのバッジ数字…
私と同じ金沢出身の中田ヤスタカはデジタルシンセで有名なNative Instrumentsのプリセットを多用していることがよく知られている。NIのMassiveやPro-53のプリセットをよく耳にしたりする。音色一つ一つを作っていってこそ面白いという時代ではないのは明らか…
NSURLからNSDataにデータを入れてそのままUIImageに投げればいいだけです。 簡単ですが忘れがち。非同期にするにはちょっと工夫がいりますね。ここでは実装してません。 UIImageView * imageView = [[UIImageView alloc]init]; NSURL *url = [NSURL URLWithS…
- (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の使い方とか参考になれば。 http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSTimer_Class/Reference/NSTimer.html#//apple_ref/doc/uid…
iOS(iPhone/iPad)アプリケーション公開申請までの流れをなるべく分かりやすく確認できるように工夫して書きました。application1.xcodeprojというプロジェクトで開発を進めたということで話を進めています。プロジェクト名が違う場合は置き換えてください。 …
AVAudioPlayerを使ったライブラリを作りました。AVAudioPlayerの実例が少なかったからしっかりとまとめた。AudioQueueとかAudioUnitじゃないとできないんじゃないの?ということがAVAudioPlayerでできます。 AudioPlayerDelegateをdelegateして使いたいクラ…
AVAudioPlayerを使って音楽を再生する方法です。再生時間をNSTimerを使って表示しています。NSRunLoopでも表示は可能かと思いますがNSTimerのほうがはるかに楽です。githubにもございます。 GitHub - kmusiclife/AudioPlayer: This is AudioPlayer class ext…
- (NSMutableArray *)randomizedArray:(NSMutableArray *)filename{ srand([[NSDate date] timeIntervalSinceReferenceDate]); int i = [filenames count]; while(--i) { int j = rand() % (i+1); [filenames exchangeObjectAtIndex:i withObjectAtIndex:j];…
UIViewContentMode typedef enum { UIViewContentModeScaleToFill, // これがデフォルト。UIImageViewにめいっぱいひろげる UIViewContentModeScaleAspectFit, // 画像のaspect比を維持し、ちょうどはいるようにする UIViewContentModeScaleAspectFill, // …
UIViewControllerを利用した上で右フリック・左フリック・上フリック・下フリックを検出する方法です。UIViewControllerのdelegateで実装される -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event -(void)touchesEnded:(NSSet *)touches wit…