万年素人からHackerへの道

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

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

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

    .gitignoreを後から適用

    ファイル自体を消したい git rm --cached -f db.sqlite3 rm 'db.sqlite3'mediaディレクトリ配下を消したい ※mediaディレクトリ自体は残す rオプションがあればディレクトリ配下になる。 git rm --cached -f media/* -r rm 'media/icon/2014/08/13/imgres.jpg…

    SessionによるPython SQLAlchemy

    ・DB作成 users.create(engine) Insert db_session.execute(users.insert(), [ {"id": 7, "name": "somename7"}, {"id": 8, "name": "somename8"}, {"id": 9, "name": "somename9"} ]) ※DB作成しておかないとInsertができない。Dropも。他のInsert user = Us…

    Python SQLAlchemyの実行

    r = users.select(users.c.id == 1).execute().first() の結果。 Error Traceback (most recent call last): File "/Users/sugita/flask_app/socket_unity/database_test.py", line 35, in test_empty_db r = users.select(users.c.id == 1).execute().first…

    gitでBitbucketのエラー

    Failed to add the host to the list of known hosts (/home/dev/.ssh/known_hosts). Permission denied (publickey).http://www.gregpike.net/2012/12/development-environment/how-to-fix-failed-to-add-the-host-to-the-list-of-known-hosts-homeuser-ssh…

    AtlasからSpriteの取得 Unity

    UnityEngine.Object[] allSprites = AssetDatabase.LoadAllAssetRepresentationsAtPath("Assets/Atlases/GamePlay/GameItem/Images/itemGetEffectAtlas.png"); なぜか面倒。直接できないのか?

    Unity Editorでのプロパティ

    ゲーム開発の民主化を謳うUnityにはドキュメントに書いてない。URL: http://anchan828.hatenablog.jp/entry/2013/12/03/153608 を参考にする。URL: http://forum.unity3d.com/threads/lack-of-scripting-functionality-for-creating-2d-animation-clips-by-c…

    C# enumをfloatにキャスト Unity

    enumはint型にキャストできるが、 一旦、intにしてfloatにするのと、 そのままfloatでキャストできるか実験してみる。色を出したいのでLogErrorのログで出してみる。 Debug.LogError ((float)((int)AttackType.SMALL)); Debug.LogError ((float)(AttackType.…

    Create a Sprite Animation Clip in Code

    URL: http://answers.unity3d.com/questions/694546/create-a-sprite-animation-clip-in-code.html

    AnimatorからAnimatorControllerを取得するまで Unity C#

    ↓ ↓ Animator animator = selectedObject.GetComponent<Animator>(); RuntimeAnimatorController runtimeAnimatorController = animator.runtimeAnimatorController; Debug.Log (runtimeAnim のままだと、まだruntimeAnimatorControllerはRuntimeAnimatorController型</animator>…

    すぎマージでAtlasを生成 Python

    Unityの2dのSprite機能を使うために、Atlas生成はNGUIとかだとうまく順番通りにしてくれない。 必要なもの ・gitコマンド ・wxPython3.0-osx-3.0.0.0-cocoa-py2.7 ・PIL ・Python 2.x使い方 git clone https://github.com/shinriyo/sugi_merge.git cd sugi_m…

    JSでFlashのボタンを押下 ディスパッチ

    http://tmlife.net/programming/javascript/javascript-tips-dispatchevent.html

    ./コマンドについて理解していないので

    URL: http://www.freeshow.net.cn/en/questions/62ab3407047ca39949159cc52b7e19fdf7f29928bcd7a62604d242d338f874df/日本語自動翻訳: http://www.freeshow.net.cn/ja/questions/62ab3407047ca39949159cc52b7e19fdf7f29928bcd7a62604d242d338f874df/

    JSのインクリメントの返り値

    var hoge = function (i) { return i++; } これだと、 hoge(0)だと0が返ってくる。 var hoge = function (i) { return ++i; } と左につける。

    cocos-JS functionの入れ子の時のthis指定での変数の意味

    var TitleLayer = cc.Layer.extend({ selectCount: 0, // 使いたい変数 ctor: function() { // 呼ばれる関数 var calledFunc = function() { cc.log(this.selectCount); // これをログに出す } // 略〜〜〜〜 var hogeButton = cc.MenuItemImage.create( res…

    JavaScriptの整形

    URL: http://www.dirtymarkup.com/動作が速くいいのだが、 lazyLayer.addChild(this.titleSprite, 0); return true; } }); var TitleScene = cc.Scene.extend({ onEnter: function() { this._super(); var layer = new TitleLayer(); this.addChild(layer); …

    cocos2d-JS(3.x系)のめんどくさいところ

    Spriteに対してコールバックができない var popupSprite = cc.Sprite.create(); とボタンを作ってる時に。 cc.MenuItemImage.createよろしく、 var popupSprite = cc.Sprite.create( res.TitleConfirmParent_png, res.TitleConfirmParent_png, function () {…

    Cocos Code IDEでタブをスペースと表示

    Cocos Code IDEはEclipseベースだが、 毎日使うのではないので毎回忘れるのでメモ。参考URL: http://www.hitachi.co.jp/Prod/comp/soft1/cosminexus/useful/tips/111101_eclipse-javaeditor-show-whitespace.html[command] + [,] ↓ [General] ↓ [Editors] ↓ …

    cocos2d-JSでcommon関数を

    共通関数を入れたのをsrc/common.js をクラス(厳密には関数だが)にいれると、 なぜかそのクラス(厳密には関数だが)が定義されたことになってくれない。 require("src/common.js"); を書いたらいけた。

    brew install skinny時のエラー

    brew install skinny node: Beginning with 0.8.0, this recipe now comes with npm. It appears you already have npm installed at /usr/local/lib/node_modules/npm. To use the npm that comes with this recipe, first uninstall npm with `npm uninsta…

    skinny-framework

    ScalaのRailsライクなフレームワーク。 URL: https://github.com/skinny-framework/skinny-framework日本人が作者?URL: http://skinny-framework.org/MaxOS Xはbrewでいれられる brew tap skinny-framework/alt brew install skinny 新規作成 skinny new sk…

    Python forの二重の時のインクリメント

    よく忘れるので記載。・イメージ print(x*【xのrangeの値】+y) for x in range(9): for y in range(9): print(x*9+y) ・結果 0 1 2 3 4 5 6 7 8 9 10 11 12 13 . . 80最期の値は【xのrangeの値】×【yのrangeの値】-1 0開始だから。

    PILのインストールにハマる

    Imaging-1.1.7をDLし、 /Imaging-1.1.7ディレクトリに入る。 sudo python setup.py install_imagingft.c:73:10: fatal error: 'freetype/fterrors.h' file not found #include <freetype/fterrors.h> ^ 1 error generated. error: command 'cc' failed with exit status 1の変なエ</freetype/fterrors.h>…

    wxをvirtualenvで

    OSに対してのwxを呼び出すと、 import wx ImportError: No module named wxのようにエラー。URL: http://stackoverflow.com/questions/10457647/how-do-i-install-wxpython-in-virtualenv本来のパス(OSのwxのインストール先)に対して、自分のvirtualenvの…

    Pythonでwxでのエラー時

    import wxした時に import wx Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/wxPython-3.0.0.0/lib/python2.7/site-packages/wx-3.0-osx_carbon/wx/__init__.py", line 45, in <module> from wx._core import * File "/usr/local/l</module></module></stdin>…

    py2app & PIL

    PythonでPILを使っているのを.dmg化する?http://osdir.com/ml/python-apple/2008-07/msg00033.html

    Unity ループ 音声

    忘れやすいのでメモ。 サウンドファイルのInspectorで設定する。 チェックを外す。

    UnityのScreeは役立たずなので C#

    Screen.width; Screen.height; などは、EditorではなぜかGame Sceneの解像度の設定から取得できない。URL: http://kirillmuzykov.com/unity-get-game-view-resolution/ここに解決策が! しかもリフレクションを使っている。 public class Singleton<T> where T </t>…

    UnityのScreenクラスは役立たずなので! C#

    “ゲーム開発手法の民主化”を謳っている UnityのEditorのGameシーンの左上にあるところの大きさを取りたいことがしばしばある。URL: http://docs.unity3d.com/ScriptReference/Screen-height.html Screen.width; Screen.height; などは、EditorではなぜかGame…

    cocos2d: if the index doesn't exist, it is an errorのエラー

    var homeButton = cc.MenuItemImage.create( res.hoge, res.bar, function () { // クリック次のコールバック cc.log("Menu is clicked!"); },this); homeButton.attr({ x: -100, y: winSize.height - 30, anchorX: 0.5, anchorY: 0.5 }); res.hogeがそもそ…

    Python unittest assertの種類

    URL: http://docs.python.jp/2/library/unittest.html メソッド 確認事項 初出 assertEqual(a, b) a == b assertNotEqual(a, b) a != b assertTrue(x) bool(x) is True assertFalse(x) bool(x) is False assertIs(a, b) a is b 2.7 assertIsNot(a, b) a is n…