d3.js doesn't have a .off() method to detatch existent event listeners. In order to remove an event handler, you have to set it to null:
d3.select('span').on('click', null)
Private Sub Get_Last_Used_Row_Index()
Dim wS As Worksheet
Set wS = ThisWorkbook.Sheets("Sheet1")
Debug.Print LastCol_1(wS)
Debug.Print LastCol_0(wS)
End Sub
You can choose between 2 options,
regarding if you want to know if there is no data in the worksheet :...
program typical_loop
use omp_lib
implicit none
integer, parameter :: N = 1000000, kd = kind( 1.d0 )
real( kind = kd ) :: sum, tbegin, wtime
integer :: i
sum = 0
tbegin = omp_get_wtime()
!$omp parallel do reduction( +: sum )
do i = 1, N
sum = ...
On a 8 cores Linux machine using GCC version 4.4, the C codes can be compiled and run the following way:
$ gcc -std=c99 -O3 -fopenmp loop.c -o loopc -lm
$ OMP_NUM_THREADS=1 ./loopc
Computing 1000000 cosines and summing them with 1 threads took 0.095832s
$ OMP_NUM_THREADS=2 ./loopc
Computing 100...
realloc is conceptually equivalent to malloc + memcpy + free on the other pointer.
If the size of the space requested is zero, the behavior of realloc is implementation-defined. This is similar for all memory allocation functions that receive a size parameter of value 0. Such functions may in fact ...
The following MATLAB script shows how to define and call a basic function:
myFun.m:
function [out1] = myFun(arg0, arg1)
out1 = arg0 + arg1;
end
terminal:
>> res = myFun(10, 20)
res =
30
Expression trees represent code in a tree-like data structure, where each node is an expression
Expression Trees enables dynamic modification of executable code, the execution of LINQ queries in various databases, and the creation of dynamic queries. You can compile and run code represented by expr...
configuration EnableIISFeature
{
node localhost
{
WindowsFeature IIS
{
Ensure = “Present”
Name = “Web-Server”
}
}
}
If you run this configuration in Powershell (EnableIISFeature), it will produce a localho...
To change the execution policy for the default scope (LocalMachine), use:
Set-ExecutionPolicy AllSigned
To change the policy for a specific scope, use:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy AllSigned
You can suppress the prompts by adding the -Force switch.
The following example uses expect and receive to mock an Order's call to a CreditCardService, so that the test passes only if the call is made without having to actually make it.
class Order
def cancel
CreditCardService.instance.refund transaction_id
end
end
describe Order do
des...
Because data is sensitive when dealt with between two threads (think concurrent read and concurrent write can conflict with one another, causing race conditions), a set of unique objects were made in order to facilitate the passing of data back and forth between threads. Any truly atomic operation c...
You can achieve a Persistent Bottom Sheet attaching a BottomSheetBehavior to a child View of a CoordinatorLayout:
<android.support.design.widget.CoordinatorLayout >
<!-- ..... -->
<LinearLayout
android:id="@+id/bottom_sheet"
android:elevation...
You can realize a modal bottom sheets using a BottomSheetDialogFragment.
The BottomSheetDialogFragment is a modal bottom sheet.
This is a version of DialogFragment that shows a bottom sheet using BottomSheetDialog instead of a floating dialog.
Just define the fragment:
public class MyBottomSheet...
The BottomSheetDialog is a dialog styled as a bottom sheet
Just use:
//Create a new BottomSheetDialog
BottomSheetDialog dialog = new BottomSheetDialog(context);
//Inflate the layout R.layout.my_dialog_layout
dialog.setContentView(R.layout.my_dialog_layout);
//Show the dialog
dialog.show();
...
You can use the CoordinatorLayout.Behavior to create dependencies between views. You can anchor a View to another View by:
using the layout_anchor attribute.
creating a custom Behavior and implementing the layoutDependsOn method returning true.
For example, in order to create a Behavior for m...
We have a tree data type like this:
data Tree a = Tree a [Tree a] deriving Show
And we wish to write a function that assigns a number to each node of the tree, from an incrementing counter:
tag :: Tree a -> Tree (a, Int)
The long way
First we'll do it the long way around, since it illust...
THREE.BoxGeometry builds boxes such as cuboids and cubes.
Cubes
Cubes created using THREE.BoxGeometry would use the same length for all sides.
JavaScript
//Creates scene and camera
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHe...
THREE.CylinderGeometry build cylinders.
Cylinder
Continuing from the previous example, the code to create the box could be replaced with the below.
//Makes a new cylinder with
// - a circle of radius 5 on top (1st parameter)
// - a circle of radius 5 on the bottom (2nd parameter)
// - a height...