万年素人からHackerへの道

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

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

    2015-03-01から1ヶ月間の記事一覧

    Django勉強会のメモの貼付け

    以前参加したDjango勉強会のメモの貼付け ◯Django勉強会 1.3系より1.5の方がファイル構成が綺麗になった。 ドメインロジックを書く。 プロジェクト名と サブバッケージが同じになっている django_lerning <= 同じ |- django_lerning <= 同じ urlmatch URLを…

    フェードイン nGUI Unity

    だんだん白が消えていくのを作りたい。 【Unity】シーン遷移時のフェードイン・フェードアウトを実装してみた | naichilab - Android iOSアプリ開発メモ を参考にした。これはnGUIではないが、応用できる。 using UnityEngine.UI; を忘れず、 画面全体の画像…

    svnを簡単に

    svnではgitみたいにsvnコマンドで削除や追加しなかったときの手続きが面倒。 無視ファイル以外をまとめて svn add、紛失ファイルをまとめてsvn del | Pistolfly alias svndel="svn st | grep '^!' | sed -e 's/\![ ]*/svn del /g' | sh" alias svnadd="svn s…

    正規表現のuやrってなんだ?Python

    unicode - What exactly do "u" and "r" string flags do in Python, and what are raw string literals? - Stack Overflow 英語なので今度読む

    Django Formでrequestを使いたい

    Django ModelForm, FormView and the Request Object | Ramblings on startups, NYC, advertising and hacking (mostly Python) viewにも処理がいる。

    font-awesomeを使う

    ・index.html <html lang="ja"> <head> <meta charset="UTF-8" /> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet"> </head> <body> <i class="fa fa-user"></i> <i class="fa fa-volume-up"></i> <i class="fa fa-volume-off"></i> </body> </html>…

    atomをvimモードにする

    atomのシェルコマンドのインストール メニュー [atom] → [Install Shell Commands] vimプラグインのインストール Mac OS Xのターミナルより下記コマンドを実行します apm install vim-mode

    DjangoのAdminでの外部キーをフィルター

    https://stackoverflow.com/questions/18304932/django-inline-model-admin-filter-foreign-field このようformに対してカスタムしたフォームを設定 class HogeAdmin(admin.ModelAdmin): """ HogeのAdmin """ form = HogeAdminInlineForm そのクラスを作る c…

    DjangoのUserをIDで取得

    今更ながらいつも他のソースをコピーしてたから忘れたのでメモしておく。 from django.contrib.auth.models import User user = User.objects.get(pk=user_id) nameでもuser_nameでもなく、usernameですね。 username = user.username

    PayPalとDjango paypal-django

    customが自分のカスタマイズ用のか? 何も入れないとDBには空っぽ。 @csrf_exempt def view_that_asks_for_money(request): # url = "http://47cc7e44.ngrok.com" url = "http://3ea2346f.ngrok.com" # What you want the button to do. paypal_dict = { "bu…

    null許容型のキャスト

    c# - How to convert nullable int to int - Stack Overflow Vector3?からVector3へキャストできなかった。 public void Hoge (Vector3? pos = null) { if (pos != null) { Vector3 v = pos.GetValueOrDefault (); のようにした。

    IPNの設定がなくなったとき PayPal

    一回IPNの設定するとどこから辿れるかわからなくなる。 のあとで、 で設定できる。 PDFガイドは個々にある。 http://paypal-demo.ebay.jp/Demo/downloads/IPNGuide.pdf

    IPNでハマる PayPal

    PayPal のIPNでハマった - Software development of explosion! −夢の破片(カケラ)たちの日々 別館−

    IPN取引履歴 PayPal

    PayPal マイアカウント -> 取引履歴 -> IPN取引履歴 「IPNを有効化」

    PayPal 即時支払通知の編集

    即時支払通知の編集 PayPal

    即時支払通知の編集 PayPal

    即時支払通知の編集

    Unity C# Vecror3のデフォルト値

    public void Hoge (Vector3 pos = Vector3.zero) { } のように出来ない。 しかし、new Vector3でもできない public void Hoge (Vector3 pos = new Vector3 (0, 0, 0)) { } const使うように言われるが、 private const ZERO = new Vector3 (0, 0, 0); public …

    virtualenvwrapperのworkonが動かなくなった

    source /usr/local/bin/virtualenvwrapper.sh これすれば反応した。 なぜ動かなくなったかは忘れた。 ちなみに、 ~/.zshrc に記載したら良くなった。

    Facebookアプリのハマるエラー

    Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains. 原因…

    can't compare datetime.datetime to datetime.date Pythonの日付の比較エラー

    これはややこしい。 end_date = dt.fromtimestamp( time.mktime((hoge.year, hoge.month + 2, 1, 0, 0, 0, 0, 0, 0))) if datetime.date.today() <= end_date: print 'ok' 最後のifの比較でエラー end_dateは時間なのにdatetimeは時間ではないからだ。 datet…

    Pythonで月の計算

    1ヶ月後の日付を取りたい datetime.datetime(2008, 12, 1) + datetime.timedelta(months=1) これだとエラーになる。 daysはあるのに、monthsというパラメータが取れないからだ。 [Python] 月の加減算処理ができない? | それなりブログ これを見た。 Python…

    Animatorで逆再生 Unity

    UnityのAnimatorのアニメーションは、 Animator animator = GetComponent<Animator> (); animator.speed = -1; のように逆再生が出来る。 しかし、逆再生中はループが始まりません。 How to Reverse animation of Animator and loop at frame zero - Unity Answers 質</animator>…

    UnityのAnimatorで逆再生でループ

    Reverse animation loop stops at frame zero - Unity Answers UnityのAnimatorで逆再生する方法。 しかし、0の地点のときにループしなくなる。

    No module named utils Django1.6

    Django 1.6で from django.forms.utils import ErrorList を書いたら、 No module named utils となった。 Django 1.7 https://docs.djangoproject.com/en/1.7/ref/forms/api/ Django 1.6 https://docs.djangoproject.com/en/1.6/ref/forms/api/ Django 1.7…

    DjangoでModelのFileFieldのでのupload_toの件

    class Hoge(models.Model): bar_file = models.FileField(u"barファイル", upload_to='{0}/{1}/{2}'.format( UPLOAD_BASE_PATH, 'bar_files', id), help_text=u'barファイルを選択して下さい') のように、 アップロードするファイル名にidを使いたかったので…

    KiiのFacebookとTwitterでハマりどころ

    http://documentation.kii.com/ja/guides/unity/managing-users/social-network-integration/social-network-connector/facebook/ ここにKiiを使ったFacebookのドキュメントがある。 しかしusingでインポートされてないため色々使えない。 これらを追加する…

    Twitterのアプリ登録サイト

    Twitterの開発者ページに行こうと思ったら、 Twitter Developers はいつのまにかFabricのサイトになっている。 今までのはここ。 Twitter Application Management