万年素人からHackerへの道

万年素人がHackerになれるまで殴り書きするぜ。

  • ・資産運用おすすめ
    10万円は1000円くらい利益
    資産運用ブログ アセマネ
    • ・寄付お願いします
      YENTEN:YYzNPzdsZWqr5THWAdMrKDj7GT8ietDc2W
      BitZenny:ZfpUbVya8MWQkjjGJMjA7P9pPkqaLnwPWH
      c0ban:8KG95GXdEquNpPW8xJAJf7nn5kbimQ5wj1
      Skycoin:KMqcn7x8REwwzMHPi9fV9fbNwdofYAWKRo

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

    CCScrollLayers スワイプ操作でレイヤーを変更

    URL: https://github.com/cocos2d/cocos2d-x-extensions

    Extensions and Tools cocos2d-x

    cocos2d-xの追加機能やツールのフォーラム URL: http://www.cocos2d-x.org/projects/cocos2d-x/boards/18

    HOTweenの便利メソッド

    PlugVector3[角度](長さ)みたいなメソッド 一見便利そうだけど、微妙に長い。 new PlugVector3X(30); Vector3.right * 30; new PlugVector3Y(30); Vector3.up * 30; new PlugVector3Z(30); Vector3.forward * 30; しかし、 vec + PlugVector3Y; みたいに他の…

    Thunderbirdの日付の設定 Mac

    場所:~/Library/Thunderbird/Profiles/ランダムな文字.default/prefs.jshttp://forums.mozillazine.jp/viewtopic.php?t=8168 http://level.s69.xrea.com/mozilla/index.cgi?id=20040719_DateFormat user_pref("mail.ui.display.dateformat.today", 2); わか…

    HOTween UnityのTweenプラグイン

    http://www.holoville.com/hotween/iTweenよりもいいっぽいことを書いてたので使ってみる。ダウンロードできるDLLは、 HOTweenとHOTweenMicroの2種類があるが、 HOTweenMicroはスマフォ向けなので、こっちを使いたい。・使い方1. Pluginsに入れる。2. インポ…

    File.WriteAllBytes() vs FileStream.Write() C#

    ・File.WriteAllBytes() http://msdn.microsoft.com/ja-jp/library/system.io.file.writeallbytes(v=vs.95).aspx・FileStream.Write() http://msdn.microsoft.com/ja-jp/library/system.io.filestream.write(v=vs.95).aspxこれら似たクラスがあるがどっちを…

    Streaming AssetとPersistent DataPathの注意点 Android、iOS Unity

    ・Android streamingAssetsのパスに普通のパスとして直接アクセスできない。 よって、File.Copyが使用できない。 Streaming AssetからPersistent DataPathへコピーして、 Persistent DataPathにアクセスするのが主流になる。Application.streamingAssetsPath…

    Unity StreamingAssetsをAndroidで

    public string filePath = System.IO.Path.Combine(Application.streamingAssetsPath, "MyFile"); StreamReader reader = new StreamReader (filePath);のようにやると DirectoryNotFoundException: Could not find a part of the path "/jar:file:/mnt/asec…

    Macの謎のエラー

    To change the local hostname, open System Preferences and click Sharing, then click “Edit” and type the name in the Local Hostname field.

    UnityEngineのDebugとSystem.DiagnosticsのDebugクラス

    URL: http://qiita.com/rodostw/items/39183e62ed2a1f52f690他のクラスでDebugクラスがあれば、このテクニックが使えない。 たとえば今回「SQLiteKit」で「System.Diagnostics」を使ってるのでハマった。Debug.Assertを使ってる箇所があるので、 Debugが何故…

    timeScaleについて Unity

    Time.timeScale = 0;のときにどのUpdateが動いて、どのUpdateが止まるのかを調べた 3大UpdateについてLogを仕込む。 void Update () { Debug.Log ("Update"); } void LateUpdate() { Debug.Log ("LateUpdate"); } void FixedUpdate() { Debug.Log ("FixedUpd…

    C# MonoDevelopの改行設定

    こちらも合わせて読む。http://d.hatena.ne.jp/shinriyo/20130728/p4 Place 'else if' on lineにはチェックを入れると、 else if (hoge == bar) と変な改行となってしまいますので、やめておこう。Place 'while' on lineにはチェックを入れると、 public cla…

    EditorでFinder(Macの場合)でフォルダを開きたい Unity

    Persistent Directoryのパスを入力するのが面倒くさい。 EditorUtility.OpenFolderPanel ("開くときのメッセージ", "パス", "ファイル名"); というメソッドもあるが、これだとFinderではなくダイアログボックスみたいなのが出てしまう。こういうときはこれ。…

    iOSのデータの書き込みと削除

    ・書き込み string path = "何らかのパス"; System.IO.File.WriteAllBytes(path, bytes); ・削除 string path = "何らかのパス"; System.IO.File.Delete("/private" + path); こちらは/privateが必要。ソースは、URL: http://answers.unity3d.com/questions/…

    Linq Select Unity

    こんな感じのコードをかいたら foreach (var item in bossTransforms.Select((v, i) => new { v, i })) ArgumentNullException: Argument cannot be nullとか出た。 UnityEditorでは動くが、iPhone実機ではできない。iOSではSelectでindex, valueを操作する…

    Tech Guild - Head First Git

    URL: http://devlove.doorkeeper.jp/events/5241サブバージョンはローカルリポジトリに反映してから 二段構えアップデート mergeまたはrebase fetchとmergeが別 mergeまたはrebase git ゴミのコミットはどんどんやっていい subversionはダメfetch -> merge o…

    エラー cocos2d-x Xcode

    No such file or directory: '/Users/ユーザ名/Library/Developer/Xcode/DerivedData/アプリ名-ランダムな文字列/Build/Products/Debug-iphoneos/libcocos2d.a'このエラーも発生 Workspace Integrity Couldn't Load cocos2dx.xcodeprjCleanしてもうまくいか…

    PostgreSQLインストール

    普通に入れると There has been an error. Your system seems to be configured with less than 32MB of shared memory, which is required for this application. Please see the installer README file for more information on how to configure shared m…

    Linqで数字の文字型の配列を C#

    var arr = Enumerable.Range(1, 5).Select(x=>x.ToString()).ToArray(); URL: http://stackoverflow.com/questions/14051257/c-conversion-from-int-array-to-string-array

    STATIC_URLやSTATICFILES_DIRSで、はまった Django

    ・settings.py STATIC_URL = '/static/' をしてるのにどうあがいても、staticに入れたCSSが認識されない。ドキュメントURL: https://django-staticfiles-doc-ja.readthedocs.org/en/latest/settings.html STATICFILES_DIRS = ( "/home/special.polls.com/pol…

    DjangoのMEDIA_URLとSTATIC_URL

    settings.pyに書いてあるこの定数達(厳密には変数w)位置づけがよく分からない。 しかも MEDIA_URL = '/static' STATIC_URL = '/static'とか同じのにするとエラーになる。 JS/CSSはSTATIC_URLがいいっぽいね。URL: http://stackoverflow.com/questions/853…

    Django Template Error: Could not parse the remainder: "entries/base_entries.html'' from '"entries/base_entries.html''

    これでハマった、実は {% extends "entries/base_entries.html' %}のようにシングルクォートで閉じてたのだった・・・。 {% extends "entries/base_entries.html" %}にしたらうまくいった。

    Django TemplateDoesNotExist at /entries/login/

    base.html 1 {% extends "base.html" %}このエラー。 確かに同じテンプレートの中にbase.htmlがない・・。base.htmlはDjangoはデフォルトで存在はしてなくて自分で作るのだと思う。

    Flask

    ・Flask-Admin 1.0.6 https://pypi.python.org/pypi/Flask-Admin・Bootstrap https://github.com/mbr/flask-bootstrap

    Djangoの‘Adminsite’ object has no attribute ‘root’ というエラー

    古いバージョンにはadmin.site.rootはrootではなく、urlsになっている。 ・urls.py url(r’^admin/(.*)’, admin.site.root) url(r’^admin/’, include(admin.site.urls)) || に修正する。

    WebフレームワークLapis

    Luaはluarocksで管理するっぽい。 brew install luarocksインストール luarocks install lapis ・OpenResty LuaでNginXができる。 ngx_openresty-1.2.7.8.tar.gzをDL tar zxvf ngx_openresty-1.2.7.8.tar.gz ./configure --with-luajit --with-ld-opt="-L /u…

    Python3 Pyramid

    pserve development.iniコマンドをすると、 pkg_resources.DistributionNotFound: fooというエラーが出てしまう。 ※fooは作ったPyramidプロジェクト名URL: http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/project.html#installing-your…

    Pyramidでエラー

    pkg_resources.DistributionNotFound: waitress のエラー。 URL: http://www.beyondlinux.com/2012/02/12/pyramid-faq-from-beginning-to-production-deploymen/pipでwaitressを入れるようだ sudo pip install waitress

    CRSF Django

    URL: http://d.hatena.ne.jp/CortYuming/20080917/p3 この日本語の個人のチュートリアルでハマった。POSTしたときに Forbidden (403) CSRF verification failed. Request aborted. Help Reason given for failure: CSRF token missing or incorrect. In gene…

    PlayerPrefsでの型ごとにキーは変わる? Unity

    気になったので調べた。 PlayerPrefs.SetInt("HogeKey", 3); のように保存して、 "HogeKey"という同じキーで別の型でGetできるのか?Intで保存したらStringでGetしてもキャストされて大丈夫だが、 Stringで保存したらIntでGetしてもキャストされて大丈夫では…