万年素人からHackerへの道

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

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

    2015-01-01から1年間の記事一覧

    Hugoの使い方

    Hugoの使い方 http://gohugo.io/overview/quickstart/ 公式のここがいい。 まずプロジェクト作る hugo new site /path/to/site /path/to/siteに生成される。 作成先に移動 cd /path/to/site hugo new about.md これでプロジェクト直下/path/to/site/content/…

    Linq C# indexを取る

    まずこれは行ける。 var ordinals = new string[] { "First", "Second", "Third" }; var indexed = ordinals.Select((n, i) => new { Index = i, Ordinal = n }) .Select((e) => { Debug.Log(e.Index); Debug.Log(e.Ordinal); return e; }).ToArray(); "Firs…

    EditorWindowで独自クラスの配列を行う C# Editor

    Hoge[] hoges をEditorWindowで出したい。 using UnityEngine; using UnityEditor; public class MyEditor : EditorWindow { [System.Serializable] // 必須. class Hoge { public bool boolHoge; public int intHoge; public string strHoge; } [SerializeF…

    Railsやってた人がPhonixするのに便利

    www.sitepoint.com

    brew updateが出来ない時 Mac

    brew update すると、 error: unable to unlink old '.gitignore' (Permission denied) error: unable to create file .travis.yml (Permission denied) error: unable to unlink old '.yardopts' (Permission denied) error: unable to unlink old 'CONTRIB…

    モトスミHack #76 もくもく会

    URL http://connpass.com/event/22061/ ドットインストールのRails 4のを見ながらElixir/Phoenixやってみる。 ・ドットインストール http://dotinstall.com/lessons/basic_rails_v2/ Elixir は ErlangのVM上で動くプログラミング言語です。 Elixirのバージョ…

    SerializeFieldの値にアクセス Unity C#

    SerializeFieldの値にEditorとかでアクセス HogeObjectというGameObjectにあるHogeCompコンポーネントの hogeLabelという名前のUIWidgetにアクセスすることを想定。 // GameObjectの取得 var HogeObject = GameObject.Find("HogeObject"); // コンポーネント…

    Enum型のキャスト C#

    MyEnumTypeというEnum型があるとする、 EnumはNullableではない。as演算子はNullableのみ。 (MyEnumType)obj キャストはOK。 MyEnumType as obj はだめ。

    null許容型の実験

    null許容型にnullが入った時に0比較でどうなるか実験してみた。 int? nullableInt = null; if(nullableInt == 0) { Debug.Log("int? null is zero"); } if(nullableInt == null) { Debug.Log("int? null is null"); } if((int)nullableInt == 0) { Debug.Log…

    StyleCopでC#とUnity MonoDevelop

    i-jupiter thinktank.: C# 静的コードチェックツール StyleCop C#やってる人はこれ、StyleCop必須だが、 メソッドの後に半角スペースも消すことが必須。 で設定できる。 Constructorsのスクリーンショットしか貼ってないが、 DeclarationsとかStatementsとか…

    UniClipboardをEditor拡張から呼ぶ

    クリップボードにコピーする qiita.com があったので、 UniClipboardをEditor拡張から呼ぼうとした。 「Editor」フォルダの中にいれたスクリプトによって、 UniClipboard.value = "Hello, UniClipboard!"; が呼べない。 仕方ないので「UniClipboard.value」…

    UnityのEditorのラベル固定

    http://www.toxicfork.com/90/fixed-width-labels-for-fields-in-unity3d ここがいい。英語なので今度じっくり・・。

    AnimatorのMotionが外れる Unity

    何故かこの画像のように ここにアニメーションファイルをドラッグすると外れる。 http://answers.unity3d.com/questions/770899/cant-add-motion-to-an-animator.html と調べたら、Legacyになってるから。 僕の使ったのはまだMecanimがUnityにないときのキャ…

    Inspector拡張まとめ

    その1 Isnpectorが変わる! ここがいい

    Event for Diverse Game Engineers

    Event for Diverse Game Engineers プログラムを愛するエンジニアの為の勉強会 http://peatix.com/event/100971 思い描いているものを形にするための事前準備(挨拶と会場説明込み) by ろっさむ C++, Python 土田さん 170人超え 行動する。 小さいことをまず…

    react-nativeのAndroid

    react-nativeのAndroid版が使えるっぽいので試してみた。 react-native run-android がうまくいかない。 Commandrun-androidunrecognized. Did you mean to run this inside a react-native project?と怒られる。 https://github.com/facebook/react-native/…

    ZenSetting2 MonoDevelop 文字編

    MonoDevelopの設定を良くする。 Solarizedというカラー。目に優しい。 iTermでも使える。 カラー qiita.com git clone https://github.com/oleyb/monodevelop-colors-solarized.git フォント morizyun.github.io Rictyを落とす。 MonoDevelopを再起動しよう。…

    C# Unity ポリモーフィズム実験

    Personとそれを継承したTaro作る public class Person { public string name; // 名前. public int age; // 年齢. public virtual void Say() { Debug.Log("person"); } } public class Taro : Person { public override void Say() { Debug.Log("I am taro"…

    参照実験 Unity C#

    using UnityEngine; using System.Collections; public class Skill { public string name; public int power; public string ToString() { return "[" + name + " (" + power + ")]"; } } public class Person { public string name; // 名前. public int a…

    権限がないユーザでSublime Textをsublコマンドで

    権限がないユーザでApplicationsがホーム直下などの時。 普通はシンボリックリンクを作るらしいが作る権限すらない時。 .zshrcとかに alias subl="~/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" を追記。

    Listの参照渡し C# Unity

    配列系は勝手に参照渡しではない。一応確認。 using UnityEngine; using System.Collections; using System.Collections.Generic; public class RefTest : MonoBehaviour { // Use this for initialization void Start () { List<string> listRef = new List<string>(); list</string></string>…

    今再生しているアニメーション名を取得 Unity C#

    d.hatena.ne.jp ↑この記事のC#版 ”今、再生している”アニメーション名を取る ただanimationで取れなくなったので、 docs.unity3d.com Animation animation GetComponent<Animation>(); しておき、 string GetCertainlyAnimationName () { var bestWeight = -1.0; string</animation>…

    setもgetもあるのをリフレクションで取りたい C# Unity

    リフレクションであるプロパティにアクセスしたい。 var qry = typeof(Foo).type.GetProperties(BindingFlags.Public|BindingFlags.Instance); だとsetプロパティがないのもとれてしまう・・・。 http://stackoverflow.com/questions/302476/how-do-you-find…

    「意識の低い」Docker勉強会 ~ エンジニアのためのプレゼン技術研究会 番外編 ~

    http://infrapre.connpass.com/event/17896/ 2015年8月22日 ・Kitematic(カイトマティック) https://kitematic.com/ Dockerが買収 コンテナごと上げるのが主流に成る? Electron(node.js) ◯インストール mkdir ~/Docker vagrant box add trusty64 h…

    新しいiPhoneを手に入れた時 iTunes

    Restore from this backup:を選ぶ。

    要素0のジャグ配列を作成 C#

    すべての要素が0のジャグ配列(配列の配列)を作りたい。 using System.Linq; でusingしておき、 int row = 10; int column = 10; int[][] arrArr = Enumerable.Range(0, row).Select( x => Enumerable.Range(0, column).Select(y => y * 0).ToArray<int>() ).ToA</int>…

    ElixirでHello World

    クラス的なHelloモジュールを作る 「defmodule」はtypoかと思ったが、「def module」ではなくそのまま続ける。 defmodule Hello do def print do IO.puts "Hello World" end end Hello.print Hello.printってのは実際の実行。 elixir hello.exs で実行する

    Phoenixの起動でエラー

    mix phoenix.server でサーバ起動しようとしたら。 Compiled lib/phoenixapp.ex [warning] calling "plug :router, YourApp.Router" in your endpoint is deprecated, plug your router directly instead: "plug YourApp.Router" lib/phoenixapp/endpoint.ex…

    二次元int配列を全部0で埋める

    Linqなので忘れずこれ using System.Linq; こうする int rowMax = 10; int columnMax = 10; private int[][] myArray = new int[rowMax][]; for (var i = 0;i < columnMax; i++) { var seq = Enumerable.Range(0, rowMax).Select(x => x * 0).ToArray<int>(); myA</int>…

    UniRxでDestroyする時の注意

    以下のようにやってる場合。 void Awake () { IObservable<long> updateStream = Observable.EveryUpdate (); updateStream.Subscribe (count => Fade ()).AddTo(eventResources); } のようにしているとこのFade()メソッドに関連しているオブジェクトがDestroyされ</long>…