2013年4月21日日曜日

iPhone5、バグる。。

16GBのiPhone5さんにとうとう限界が来ました。

アプリを入れすぎてしまい、iTunesにバックアップしようとしたら
空き容量が足りませんといわれ、エラーに。

あーあと思って見てみると、なんだか異常な光景。。
アプリの一部がダウンロード中のような薄暗いアイコンになり、バーが表示されています。
でも全く進みません。
タップしてみると『待機中』となり、やっぱり全く進みません。

仕方ないので薄暗いやつを一旦全て削除し、iTunesで再度同期すると、
iPhoneとiTunesの表示が一致しないまま『完了』とか言われる。。
バックアップ削除したり、Macの内部にあったAppのライブラリを全て削除したり
いろいろやっていたのですが、もうひとつ異変が。
iPhoneの容量が表示されているところを見ると、Appではなく『その他』が10GBに!
しかも、アプリを削除しても減らない!

もうわけわかりません。再起動。

すると、アプリが増えてる!!
えっ!!
削除したやつが全部戻ってきた!!

どうやらエラーになった時点で何か内部情報が壊れたのか、
アプリがエラー直前の状態に戻ってしまう様子。
『その他』が10GBもあるのはこれか。。
完全にバグっている。

Appleさんのサポートに電話。
いろいろ試した結果、
『OSに問題があるのかも、出荷状態に戻しましょう』と、そうなりますか。

iTunesでバックアップとり、購入したアプリも退避、写真もMacに退避。
私はauさんなので、アドレス帳の復元は失敗することがあるとかないとか。
メールとかカレンダーとかも退避いるのかな、、、面倒だからもういいや!


iPhoneを『復元』!

iTunesが最新のOSをダウンロードしている。
ほうほう、OSを上書きして、iTunesからバックアップを戻す様子。

おっ、超簡単ではないですか。


やったー!!
その他容量が700MBに縮小、
空き容量が10GBに!
リフレッシュ!!

しかもメールやアドレス帳も戻っている!!


ふー、疲れた。

2013年3月20日水曜日

Bloggerにソースコードを表示 その2

前回書いたソースコードの表示では、縦のスクロールバーが表示されます。
でもいらないですよね。
前回追加したshCore.cssを自作のものに切り替えることで、表示を変更できます。
前回同様、こちらを参考にさせて頂きました。

1. Bloggerのメニューから、テンプレート > HTMLの編集
2. shCore.cssをコメントアウトし、保存
<!-- <link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/> -->
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'/>
3. Bloggerのメニューから、テンプレート > カスタマイズ > アドバンス > CSSを追加
4. 以下を貼り付けて、適用
<link -moz-border-radius:="" -webkit-border-radius:="" .5em="" .9em="" .bold="" .container="" .italic="" .line="" .syntaxhighlighter.collapsed="" .syntaxhighlighter.ie="" .syntaxhighlighter.nogutter="" .syntaxhighlighter.show="" .syntaxhighlighter.source="" .syntaxhighlighter="" .toolbar="" 0.1em="" 0.5em="" 0.8em="" 02="" 0="" 0em="" 1.1em="" 100="" 10="" 10px="" 11px="" 1em="" 1px-="" 1px="" 2004-2010="" 2010="" 20px="" 3.0.83="" a.expandsource="" a="" absolute="" alex="" alexgorbatchev.com="" and="" are="" auto="" background:="" baseline="" block="" bold="" border-box="" border:="" bottom:="" box-sizing:="" caption="" center="" code="" content-box="" copyright="" courier="" display:="" div="" donate.="" donate.html="" donationware.="" dual="" float:="" font-family:="" font-size:="" font-style:="" font-weight:="" gorbatchev.="" gpl="" height:="" hidden="" http:="" if="" important="" inherit="" inline="" is="" it="" italic="" itstream="" left:="" left="" license="" licensed="" licenses.="" line-height:="" margin-right:="" margin:="" min-height:="" mit="" mono="" monospace="" new="" none="" normal="" onsolas="" ourier="" outline:="" overflow-y:="" overflow:="" padding-left:="" padding-top:="" padding:="" please="" position:="" pre="" relative="" right:="" right="" sans="" span.title="" span="" static="" syntaxhighlighter="" table="" tbody="" td.code="" td.gutter="" td="" text-align:="" text-decoration:="" textarea="" the="" thead="" top:="" tr="" uly="" under="" using="" vera="" version="" vertical-align:="" visible="" white-space:="" white="" width:="" yntaxhighlighter="" you="" z-index:=""></link>20pxに変更,IEで最後の行が横スクロールバーに隠れるのを防ぐ
}
.syntaxhighlighter.ie .toolbar {
  line-height: 8px !important;
}
.syntaxhighlighter.ie .toolbar a {
  padding-top: 0px !important;
}
.syntaxhighlighter.printing .line.alt1 .content,
.syntaxhighlighter.printing .line.alt2 .content,
.syntaxhighlighter.printing .line.highlighted .number,
.syntaxhighlighter.printing .line.highlighted.alt1 .content,
.syntaxhighlighter.printing .line.highlighted.alt2 .content {
  background: none !important;
}
.syntaxhighlighter.printing .line .number {
  color: #bbbbbb !important;
}
.syntaxhighlighter.printing .line .content {
  color: black !important;
}
.syntaxhighlighter.printing .toolbar {
  display: none !important;
}
.syntaxhighlighter.printing a {
  text-decoration: none !important;
}
.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
  color: black !important;
}
.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
  color: #008200 !important;
}
.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
  color: blue !important;
}
.syntaxhighlighter.printing .keyword {
  color: #006699 !important;
  font-weight: bold !important;
}
.syntaxhighlighter.printing .preprocessor {
  color: gray !important;
}
.syntaxhighlighter.printing .variable {
  color: #aa7700 !important;
}
.syntaxhighlighter.printing .value {
  color: #009900 !important;
}
.syntaxhighlighter.printing .functions {
  color: #ff1493 !important;
}
.syntaxhighlighter.printing .constants {
  color: #0066cc !important;
}
.syntaxhighlighter.printing .script {
  font-weight: bold !important;
}
.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
  color: gray !important;
}
.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
  color: #ff1493 !important;
}
.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
  color: red !important;
}
.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
  color: black !important;
}
これで、縦スクロールバーが表示されなくなります!!

2013年3月19日火曜日

Bloggerにソースコードを表示

ソースコードを綺麗に表示するには、
『SyntaxHighlighter』を使用すると良いようです。

こちらを参考にさせて頂きました。

すぐやりたい!という人は、以下でできます。

1. Bloggerのメニューから、テンプレート > HTMLの編集
2. </head>の直前に、以下を追記し、保存。
<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/shThemeDefault.css" rel="stylesheet" type="text/css"></link>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js" type="text/javascript"></script>
<script language="javascript">
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf';
SyntaxHighlighter.all();
</script>
3. Bloggerのメニューから投稿、『作成』ボタンの横にある『HTML』を選択
4. 『<』を『&lt;』に置換したソースコードを以下のように貼り付ける

<pre class="brush: ◯; first-line: 1; highlight: [,];" title="">
ソースコード
</pre>

※◯に言語を指定、例えばJavaなら『brush:java;』、C++なら『brush:cpp』
 この指定が、2.で4-15行目に読み込んでいるscriptに対応付けられます。
 詳細は参考サイトをご覧ください

※highlight: [,];で行番号を指定すると、行を強調できます。
 2.では、highlight: [4,5,6,7,8,9,10,11,12,13,14,15];としています。

2013年3月18日月曜日

foreachのコンパイルエラー

C++ -> androidプロジェクト
へのビルドでエラー。

range-based-for loops are not allowed in C++98 mode

なんてこった、 C++98では、foreachには対応していないらしい。。
Iteratorには対応しているらしいですが、Iteratorの書き方忘れた…
ということでベタに、
    std::vector<Levelhelper_tag> tags;

    tags.push_back(OBJECT_A);
    tags.push_back(OBJECT_B);

    for (LevelHelper_TAG tag : tags) {

    }
としていたのを、
    std::vector<LevelHelper_TAG> tags;

    tags.push_back(OBJECT_A);
    tags.push_back(OBJECT_B);

    for (int i = 0; i < tags.size(); i++) {
        LevelHelper_TAG tag = tags.at(i);
    }
としたら、通りました。

2013年3月17日日曜日

現在の開発環境

前回開発に使用するツールを書きましたが、
現在はCocos2d-xというFWを使用しています。

ゲーム用ですが、マルチプラットフォーム対応のFWで、
iPhoneアプリとandroidアプリが同時に作れます。
言語はC++です。

まとめると今の開発環境は、
・PC
 MacBook Air

・IDE
 XCode 4.6

・FW
 cocos2d-x

・グラフィック
 GIMP 2.0

・スプライト
 SpriteHelper
 LevelHelper

となっています。

流れとしては、

1) グラフィック作成
    スプライト配置、設定

     C++でiPhoneアプリをコーディング
     Javaでandroidネイティブな部分をコーディング
2) ビルドしてandroidプロジェクトを作成
3) 広告組み込みなど
4) リリース


といった感じです。


2013年3月16日土曜日

フラッシュフォワード その2

前回書いたフラッシュフォワード、
もうちょっと語りたいので、その2です。

作中で記憶に残った、

『エヴェレットの多世界解釈』

という言葉。

物理学や量子力学で出てくるワードらしく、
Wikipedia見ても良く理解できませんでした(- -)

意味としては、いわゆるパラレルワールドのことです。

半年後の未来を見た自分は、その通りにしないという選択ができるわけです。

少しだけ違う、色々な世界が『有り得る』というのが、
そもそもこのドラマの面白いところなわけですが、
これを恋愛に当てはめるとこういうワードが出てきます。

街ですれ違った私達は、別の宇宙ではそこで知り合っていて、
結婚していたかも知れないね。なんつって。

頭の良い人間は口説き文句もスゴいんだなぁ、
と妙に納得しました。

2013年3月15日金曜日

フラッシュフォワード

ちょっと前に観ました。

フラッシュバックの逆で、未来を見るフラッシュフォワード。
地球規模で人々が意識を失い、その間に半年先の自分を見ていた。

これ聴いただけでも興味が湧きます。
で、シーズン1を全部観たんですが…、

衝撃!!


シーズン2が無い!
DVDが無いとかではなく、

作ってない!!


シーズン1の最後は、完全に『つづきはまた来週(^^)』
みたいな終わりかたなのに。
何か製作側でいろいろあったようで、もう作られる予定もないそうです。。

最初にそれを知っていたら観なかった。

とはいえ、
タイトル:フラッシュフォワード
ジャンル:ドラマ
主演  :ジョセフ・ファインズ
評価  :80 / 100 点


内容は本当に面白い。
なんと我等が日本から、竹内結子さんも出ているのです!演技上手い!かわいい!
必見です。

しかしなんとも、消化不良。