ReorderableList
を使いたいが
interfaceはシリアライズにできないので
http://answers.unity3d.com/questions/783456/solution-how-to-serialize-interfaces-generics-auto.html
carとcdrはなんの略?Lisp
car (short for "Contents of the Address part of Register number"), cdr ("Contents of the Decrement part of Register number"), cpr ("Contents of the Prefix part of Register number"), and ctr ("Contents of the Tag part of Register number"),
色んなバリエーションあるのね。 command - Explanation of CAR, CDR, CADAR, etc - Stack Overflow
CommonLispのWebサーバ Wookieを使う
まずこれが必須みたい。
libuvのインストール
brew install --HEAD libuv
libuvを入れずにWookieをインストール時のエラー
* (ql:quickload :wookie) To load "wookie": Load 1 ASDF system: wookie ; Loading "wookie" .. debugger invoked on a LOAD-FOREIGN-LIBRARY-ERROR in thread #<THREAD "main thread" RUNNING {1001F1EAB3}>: Unable to load any of the alternatives: ("libuv.dylib")
になってしまうからね。
Wookieのインストール
(ql:quickload :wookie)
MastodonでのVagrant起動
vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Checking if box 'ubuntu/trusty64' is up to date... ==> default: [vagrant-hostsupdater] Checking for host entries ==> default: [vagrant-hostsupdater] found entry for: 192.168.42.42 mastodon.dev ==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision` ==> default: flag to force provisioning. Provisioners marked to run always will still run. ==> default: Running provisioner: shell... default: Running: inline script ==> default: /tmp/vagrant-shell: line 4: rails: command not found The SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed. The output for this command should be in the log above. Please read the output to determine what went wrong.
Railsがない?手動で入れたw
vagrant ssh
で入り、
vagrant@mastodon:~$ gem install rails
The SSH command responded with a non-zero exit status. Vagrant
このヘンテコなメッセージは、vagrantにsshで入った状態で
vagrant@mastodon:~$ rm -rf /etc/udev/rules.d/70-persistent-net.rules vagrant@mastodon:~$ rm -rf /etc/udev/rules.d/70-persistent-cd.rules
してexit
して抜けてvagrant reload
する。
==> default: /home/vagrant/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.14.6/lib/bundler/spec_set.rb:87:in `block in materialize' ==> default: : ==> default: Could not find actionview-5.0.2 in any of the sources ==> default: ( ==> default: Bundler::GemNotFound ==> default: )
って・・・
vagrant@mastodon:~$ gem install actionview
してもだめ。
仕方ないのでvagrant ssh
で入って、
mastodon/Vagrantfile at master · tootsuite/mastodon · GitHub
ここにあるVagrantfile
にある以下のコマンドを行った。
# Install gems and node modules gem install bundler bundle install yarn install
このあとホストマシンで、vagrant up
した。
以下でエラー出る・・。
/vagrant/app/views/about/show.html.haml
Django 1.11でのタグ使用時に勝手にエスケープされてしまう
今までこのように買いていた。
@register.simple_tag def calc_rate(star): """ 星を計算する(評価者一覧の方) :param star: 星の数の数字 """ html = """ <p> """ star = '<span class="glyphicon glyphicon-star"></span>' * star html += star html += """ </p> """ return html
しかし、いざtemplateで
<div class="ratings"> {% calc_rate item.star %} </div>
のように使用するときにHTMLのタグ自体がそのまま表示されてしまう。
https://docs.djangoproject.com/en/1.11/howto/custom-template-tags/
おそらくエスケープを勝手にされていた?ので。
from django.utils.safestring import mark_safe
をインポートし、
最後のreturn
にて
return mark_safe(html)
したら大丈夫になった。