9 Matching Annotations
- Apr 2018
-
vaidehijoshi.github.io vaidehijoshi.github.io
-
The second reason this is interesting is because of callbacks that are associated with these two methods. A callback hook like after_save is actually part of the same active transaction that was opened when we called @user.save. So, if we wanted our code to execute outside of Rails’ default transaction that wraps around save or destroy, we’d want to use callback hooks like after_commit or after_destroy. If we want something specific to happen when the save transaction succeeds, we’d have to use the after_commit callback, and if we want something specific to happen when the save transaction fails, we could use the after_rollback hook.
Rails transaction callbacks done right
-
- Aug 2017
-
github.com github.com
-
If it does not implement the touch method
Sequelize only have
update
method to update theupdateAt
field. Research is needed to use this kind of touch method.
-
- Apr 2017
-
webpack.js.org webpack.js.orgCaching1
-
//<![CDATA[ window.webpackManifest = {"0":"main.5f020f80c23aa50ebedf.js","1":"vendor.81adc64d405c8b218485.js"} //]]>
-
- Apr 2016
-
github.com github.com
-
+fx(d, ++i)
add + sign to the left is a shorthand to converting to numbers.
- +'-3.2' => -3.2
- +'yoo' => NaN
-
i = below << 1 | right
bit string as index
-
else
whenever there's the second node adding in, split the node into 2 leaves in the subtree.
-
d
d for data, stored in
node.point
-
d3_functor
intuitively i think is a simple accessor:
- d3_functor(x) = (d => d.x)
- d3_functor(y) = (d => d.y)
But the implementation is more simpler, it's just a wrapper to make "identity" function:
function d3_functor(v) { return typeof v === "function" ? v : function() { return v; }; } d3.functor = d3_functor;
So:
- d3functor(3) = ( => 3)
- d3_functor(d => d.x) = (d => d.x)
: )
-
if (dx > dy) y2_ = y1_ + dx;
That's why input (-180, -90, 180, 90) yields extent (-180, -90, 180, 270).
Making square is just convenient for building quad tree.
-