This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
render() { // render method of component | |
//... | |
<div className="column-icons"> | |
{ canHideColumns && renderHideColumnsTrigger() } | |
{ canSort && renderSortingIndicator() } // shows the sort icon | |
{ canSearch && renderSearchTrigger() } // shows the filter icon | |
{ canRemoveColumns && <RemoveColumnButton /> } | |
{ canAddColumns && <AddColumnButton } | |
</div> | |
//... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
import sys | |
def isCavity(grid, coordinate): | |
(r, c) = coordinate | |
value = grid[r][c] | |
maxRow = len(grid) - 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Definition for an interval. | |
# class Interval(object): | |
# def __init__(self, s=0, e=0): | |
# self.start = s | |
# self.end = e | |
class Solution(object): | |
def merge(self, intervals): | |
""" | |
:type intervals: List[Interval] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def number_needed(a, b): | |
dictA = {} | |
dictB = {} | |
for c in a: | |
if c in dictA: | |
dictA[c] += 1 | |
else: | |
dictA[c] = 1 | |
for c in b: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder