2012年9月3日月曜日

P-news



Description P-newsは
pixivが配信している
このページのnewsをiphoneで読むためのアプリです。
このアプリがあると、アニメ等の最新情報を取得するのが捗ります。
読めるカテゴリーは
・総合 注目
・アニメ
・マンガ・ラノベ
・フィギュア・グッズ
・ゲーム
・音楽
・アート・デザイン
・IT・テクノロジー
・コラム
・一般
・ピクシブ通信
です。

無料です。

2012年8月29日水曜日

flash-memo紹介




http://itunes.apple.com/us/app/flash-memo/id492237570?l=ja&ls=1&mt=8

短い内容をメモするのに便利なiphone appです。

タップでクリップボードにコピーできます。

iCloudで同期出来ます。

作成日、更新日、コピー回数で並べ替え出来ます。

無料です。
____________________________________________










2012年7月6日金曜日

Mr.zips




新しいiphoneアプリを作りました。

カメラロールの画像をまとめてzipに保存します。

wifiで共有したりできます。


iphoneスクリーンショット












ipadスクリーンショット












2012年7月2日月曜日

arc対応のソースを混在させる。

http://program.station.ez-net.jp/special/objective-c/llvm/arc/enable-file.asp


// ARC を有効化したい場合
-fobjc-arc
 
// ARC を無効化したい場合
-fno-objc-arc

ビルドするところを、ターゲット別に分ける

無料版と有料版で動作を変えるためにマクロを設定する。

Freeターゲットの
Build Settings
LLVM GCC 4.2 - Preprocessing
の項目で、
Preprocessor Macros に
_FREE_
を追加。

ソースコードで、
#ifdef _FREE_
   
#else
   
#endif
とする。

2012年7月1日日曜日

eveblo

Welcome to Eveblo!

Do you think open your note more easily.

To put this idea in practice , I use Evernote and blogger in close cooperation with each other.

I write this entry used by Evernote .

This is the original note .

Examples are as follows.
  1. Change Font .color,bold,italic,UNDERLINE
  2. Hyper link . ex) Evernote
  3.   checkbox
  4. left
  5. center
  6. right
  7. horizon line


  8. Insert image    
  9. List (now using)
  10. table
    service
    link
    Evernotehttp://evernote.com/
    Bloggerhttp://www.blogger.com/

Do you want to publish your note easily ?


eveblo_jp

Welcome to Eveblo!


あなたは簡単にノートをブログに公開しようと考えたことはありませんか?
私はEvernoteとbloggerを連携することで、これを解決することにしました。

このblogのエントリーもEvernoteで書かれています。
その共有URLはこちらです。

Evernoteに書かれているものなら、そのままblogに公開されます。
以下にどのようなことができるのかを例示します。
  1. Fontの変更。color,bold,italic,UNDERLINE
  2.   チェックボックス
  3. left
  4. center
  5. right
  6. 水平線

  7. 画像の挿入    
  8. リストの表示。(現在使用中です)
  9. 表の表示。
    service
    link
    Evernotehttp://evernote.com/
    Bloggerhttp://www.blogger.com/

皆さんもノートを広く公開しませんか?

2012年6月13日水曜日

mac lionで $ rvm install 1.9.1 が出来ない。

$ rvm get latest
$ rvm reload
$ rvm version

rvm 1.14.1 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

$ rvm install 1.9.1
The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.

LLVMじゃコンパイルは出来ねーぞみたいなことが書いてある。

gccが入ってあるか探す。

$ ls /usr/bin/ | grep gcc
gcc
i686-apple-darwin11-llvm-gcc-4.2
llvm-gcc
llvm-gcc-4.2

コンパイルにgccを使うために環境変数を指定。
$ export CC=gcc


$ rvm install 1.9.1

Ruby 'ruby-1.9.1-p431' was build using clang - but it's not (fully) supported, expect errors.
Please be aware that you just installed a ruby that requires        2 patches just to be compiled on up to date linux system.
This may have known and unaccounted for security vulnerabilities.
Please consider upgrading to Ruby 1.9.3-194 which will have all of the latest security patches.

Ruby 1.9.3-194を使えよって警告がでたけど気にしない


$ rvm list

rvm rubies

   ruby-1.9.1-p431 [ i386 ]

$ rvm install 1.9.1

できた!

2012年6月8日金曜日

herokuで複数アカウント、

一つのMacに会社と自分のherokuアカウントを使い分ける



$ heroku plugins:install git://github.com/ddollar/heroku-accounts.git


$ heroku accounts:add new_user --auto

Enter your Heroku credentials.
Email: 

Password (typing will be hidden): 




プロジェクト毎にアカウントを設定する。
各プロジェクト毎に利用するHerokuアカウントを設定するには、プロジェクトのディレクトリでaccounts:setサブコマンドを実行する。

$ cd $RAILS_APP

$ heroku accounts:set new_user




herokuのpush先を変更する

$ git remote add heroku git@heroku.new_user:app_name.git



ここのpush先のURLの指定に一番ハマりました。



masterをpush

$ git push heroku master



branch hugeをpush

$ git push heroku hoge:master



参考ページ



2012年6月7日木曜日

evernoteにweb aplictionの申請した時のやり取り

evernote apiを使った、 webアプリケーションが公開出来たので、evernote社とのやり取りについてまとめます。





のformでapiキーを取得する。

すると、

Consumer Key と Consumer Secret が 書かれたメールが帰ってきます。

最初は https://sandbox.evernote.com でテストアカウントを作る必要があります。

これらを使って、開発します。



2,


このページや


でSDKをダウンロードしてどんなものか確かめます。



3,開発が終わったら


からその旨を申請します。

メッセージには、以下の情報をいれないといけないみたい。

メールでやり取りするときにきかれました。



1. アプリケーションの名称
2. アプリケーション提供者の名称

3. アプリケーション提供元のURL

4. 短いアプリケーションの説明


5.電子メールアドレス(アプリケーション提供元のドメインに属するもの)



ここまでできたら、プログラムで使っているurlを


から


に変更したら本番環境でも動きました。



2011年3月30日水曜日

ブックマークレット

たまにインターネットで見かけるブックマークするだけで色んなことが出来るアプリ見たいのはなんていうのだろうと思っていたけど、ブックマークレットって言うらしい。
参照 http://bit.ly/eF6mAu

phpのechoとprintの違い

echoはカンマ「,」で区切れる。printはだめ。
echoは結果を返さない。だから変数に代入とかは出来ない。
printは結果を返す。

参照 http://nyx.pu1.net/reference/extra/echo_print.html

MYSQLのtext型にprimaryキー付ける。

参照 http://fdays.blogspot.com/2009/02/mysql-text-index.html

2011年3月24日木曜日

phpの論理型

phpでの論理型が偽となる場合はは次の通り。


その他の値は全て TRUE とみなされます
だそうだ。

参照  http://www.php.net/manual/ja/language.types.boolean.php#language.types.boolean.casting

Mysqlにphpで接続

<?php
$link 
= mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!
$link) {
    die(
'接続できませんでした: ' . mysql_error());
}
echo 
'接続に成功しました';mysql_close($link);?>



mysql_connect()の返り値は以下の通り。

成功した場合に MySQL リンク ID を、失敗した場合に FALSE を返します。

参照 http://jp2.php.net/manual/ja/function.mysql-connect.php

2011年3月23日水曜日

phpのexplode()について

explode() 関数は配列の区切り方を自由に決めることができる。

参照 http://nyx.pu1.net/function/strings/explode.php

phpでrss1.0 rss2.0 atom0.3 atom1.0を読み込み、表示するコード

<?php //rss1.0 rss2.0 atom対応
$rss_url = array( //配列にrss1.0 またはrss2.0 またはatomのurlを入力
                "http://tannsokuvip.blog54.fc2.com/?xml",  //rss1.0
                "http://blog.goo.ne.jp/staffblog/rss2.xml", //rss2.0
                "http://hamusoku.com/atom.xml" //atom
            );

rss($rss_url);

function rss($rss_url){  //こっから下はもっとスマートに書けると思うけど自分の技術不足のため放置
    foreach($rss_url as $url){
        $rss =  simplexml_load_file("$url");
    if($rss->entry){  //atomの条件
    foreach ($rss->entry as $ent){
            print "<p>";
            print $ent->title;
            print "<br>";
            print $ent->link['href'];   //xmlの属性へのアクセスの仕方 http://www.phppro.jp/qa/1308 のA3にヒント
            print "<br>";
            print $rss->title;
            print "<br>";
            if($ent->issued){                                        //atom エントリーが公開された日時
            print date('Y年n月j日G時i分',strtotime($ent->issued));   //atom version=0.3
            }else if($ent->updated){                                //strtotime() 参照 http://jp2.php.net/manual/ja/function.strtotime.php
            print date('Y年n月j日G時i分',strtotime($ent->updated));  //atom version=1.0,  date() 参照 http://jp2.php.net/manual/ja/function.date.php
            }   
            print "<br>";
            print "</p>";
        }
    }
    elseif($rss->item){  //rss1.0
        foreach ($rss->item as $item){
            $dc = $item->children('http://purl.org/dc/elements/1.1/');
            print "<p>";
            print $item->title;
            print "<br>";
            print $item->link;
            print "<br>";
            print $rss->channel->title;
            print "<br>";
            print date('Y年n月j日G時i分',strtotime($dc->date));
            print "<br>";
            print "</p>";
        }
    }elseif($rss->channel->item){ //rss2.0
        foreach ($rss->channel->item as $item){
            $dc = $item->children('http://purl.org/dc/elements/1.1/');
            print "<p>";
            print $item->title;
            print "<br>";
            print $item->link;
            print "<br>";
            print $rss->channel->title;
            print "<br>";
            print date('Y年n月j日G時i分',strtotime($dc->date));
            print "<br>";
            print "</p>";
        }
    }
    }
}
?>



phpでatom0.3とatom1.0を表示

<?php //atom用 複数urlの指定
$rss_url = array(
                'http://hamusoku.com/atom.xml'  //この配列にatomのurlを指定する
                ,'http://blog.livedoor.jp/himasoku123/atom.xml'
                ,'http://natalie.mu/comic/feed/news'
            );

rss_atom($rss_url);

function rss_atom($rss_url){
    foreach($rss_url as $url){
        $atom =  simplexml_load_file("$url");
        foreach ($atom->entry as $ent){
            print "<p>";
            print $ent->title;
            print "<br>";
            print $ent->link['href'];   //xmlの属性へのアクセスの仕方 http://www.phppro.jp/qa/1308 のA3にヒント
            print "<br>";
            print $atom->title;
            print "<br>";
            if($ent->issued){                                        //atom エントリーが公開された日時
            print date('Y年n月j日G時i分',strtotime($ent->issued));   //atom version=0.3
            }else if($ent->updated){                                //strtotime() 参照 http://jp2.php.net/manual/ja/function.strtotime.php
            print date('Y年n月j日G時i分',strtotime($ent->updated));  //atom version=1.0,  date() 参照 http://jp2.php.net/manual/ja/function.date.php
            }   
            print "<br>";
            print "</p>";
        }
    }
}
?>

GMT表示を日本語で表示

コード__________
<?php
echo strtotime("2011-03-23T00:09:32+09:00");
echo  "<br>";
echo date('Y年n月j日G時i分',strtotime("2011-03-23T00:09:32+09:00"));
?>

______________

結果_________
1300806572
2011年3月23日0時09分

_________________

strtotime()で英文形式の日付をUnixタイムスタンプに変換。その後、
 date()で日本語に変換する。

atom version=0.3の"issued",
atom version=1.0の"updated"
に対応するために調べました。


strtotime() 参照 http://jp2.php.net/manual/ja/function.strtotime.php
date() 参照 http://jp2.php.net/manual/ja/function.date.php

atomの複数urlの読み込み、表示

<?php //atom用 複数urlの指定
$rss_url = array(
                'http://hamusoku.com/atom.xml'  //この配列にatomのurlを指定する
                ,'http://blog.livedoor.jp/himasoku123/atom.xml'
                ,'http://blog.livedoor.jp/dqnplus/atom.xml'
            );

rss_atom($rss_url);

function rss_atom($rss_url){
    foreach($rss_url as $url){
        $atom =  simplexml_load_file("$url");
        foreach ($atom->entry as $ent){
            print "<p>";
            print $ent->title;
            print "<br>";
            print $ent->link['href'];   //xmlの属性へのアクセスの仕方 http://www.phppro.jp/qa/1308 のA3にヒント
            print "<br>";
            print $atom->title;
            print "<br>";
            print "</p>";
        }
    }
}
?>


サイトは痛いニュースさん、暇人\(^o^)/速報 さん、ハムスター速報さんのをお借りしています。