Debug batamanjs model in view context
Posted About 10 years ago. Visible to the public. Linked content.
To inspect a model attributes binded to a dom element
$context($("#elem-id")[0]).controller.model_name.toJSON()
Original idea taken from the link below.
Related cards:
Batmanjs Custom View
class App.AutocompleteView extends Batman.View
html: "<input type='text' />"
autocompleteSource: -> []
viewDidAppear: ->
# I had to replace @node (as it is in the official documentation) to @node.firstChild since that...
ModuleNotFoundError: No module named 'cv2' in jupyter notebook
Create a new environment with as of now python 3.7 since opencv not available in conda's python 3.8 packages
conda create --name opencv-cuda python=3.7
conda activate opencv-cuda
conda install pytorch torchvision cudatoolkit=10.2 openc...
Elixir / Phoenix system packages install on opensuse 13.2
zypper ar http://download.opensuse.org/repositories/home:/Ledest:/erlang/openSUSE_13.2/home:Ledest:erlang.repo
# for inotify (live code reload)
zypper ar http://download.opensuse.org/repositories/filesystems/openSUSE_13.2/
zypper ref
zypper ...
Memoization in ruby with nested methods
class Example
def foo
def foo
@bar
end
bar = (1..10).inject(1, :*)
puts "bar is #{bar}"
@wibble = "wibble is #{bar / 30}"
@bar = bar / 20
end
end
example = Example.new
example.foo
bar is 3628800
=> 181440...
Asssign Batmanjs model option to a select element
Given the following js model:
class MyApp.Post extends Batman.Model
@encode options
Given the server side json (generated with rabl):
object @post
attributes :id, :category
node(:categories) {
Category::OPTIONS...
Load TAGS file in emacs manually
M-x visit-tags-table
You need to point to the directory in which ETAGS file generated and it will be loaded.
Install XGBoost with GPU support with conda
conda install py-xgboost-gpu
source: https://docs.anaconda.com/anaconda/user-guide/tasks/gpu-packages/
set user home inside a docker container
ENV HOME /home/dev
USER dev
RUN curl -L https://get.rvm.io | bash -s stable
Posted by Bonyiii to Bonyiii's deck (2014-03-17 20:17)