This file contains hidden or 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
Below are the Big O performance of common functions of different Java Collections. | |
List | Add | Remove | Get | Contains | Next | Data Structure | |
---------------------|------|--------|------|----------|------|--------------- | |
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array | |
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List | |
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array |
This file contains hidden or 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
# numCourses = 4, prerequisites = [[1,0],[2,0],[3,1],[3,2]] | |
from collections import defaultdict, deque | |
class Solution: | |
def findOrder(self, numCourses, prerequisites): | |
""" | |
:type numCourses: int | |
:type prerequisites: List[List[int]] | |
:rtype: List[int] |
This file contains hidden or 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
pointer var = address | |
* = & | |
int val = 10; | |
int *p; | |
p = &val; | |
// *p is val p is pointing to | |
// p is address inside p |
This file contains hidden or 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
cmake_minimum_required(VERSION 2.8.4) | |
project(lotd) | |
find_package(PkgConfig REQUIRED) | |
pkg_search_module(EVENT REQUIRED libevent) | |
set(libname "config") | |
file(GLOB SRC |
This file contains hidden or 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
cmake_minimum_required(VERSION 2.8.12) | |
project(lotd) | |
add_definitions("-std=c++11") | |
set(libname "config") | |
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | |
conan_basic_setup() |
This file contains hidden or 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
image: docker:stable | |
stages: | |
- build | |
- test | |
variables: | |
IMAGE: ${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME} | |
build: |
This file contains hidden or 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
N/W: | |
Network Know-How | |
Head first networking |
This file contains hidden or 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
It's not something I took into consideration because for the most part the emails were being delivered pretty reliably but I can see why it might be a problem so I just had to look into it since I'm one of the contributors for that project and what I found was that the queues are not reliable (RabbitMQ is a little more reliable) as messages can be lost and redis queue (RQ) does not have a way to automatically re-do it, the failed job is flagged and stored for a year and you will have to write code to handle the exception. |
This file contains hidden or 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
class CNN(nn.Module): | |
def __init__(self, vocab_size, embedding_dim, n_filters, filter_sizes, output_dim, | |
dropout, pad_idx): | |
super().__init__() | |
self.embedding = nn.Embedding(vocab_size, embedding_dim, padding_idx = pad_idx) | |
self.conv_0 = nn.Parameter(torch.randn((1, | |
n_filters, |
NewerOlder