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
kafka-topics.sh --list --zookeeper localhost:2181 | |
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic status |
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
docker stop kafka-server && docker rm kafka-server | |
docker stop zookeeper-server && docker rm zookeeper-server | |
docker run -d --name zookeeper-server --network host -e ALLOW_ANONYMOUS_LOGIN=yes bitnami/zookeeper:latest | |
docker run -d --name kafka-server --network host -e ALLOW_PLAINTEXT_LISTENER=yes -e KAFKA_CFG_ZOOKEEPER_CONNECT=localhost:2181 bitnami/kafka:latest |
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
rosbag info --yaml --key=types[0].type 2020-07-15-11-29-48.bag |
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
select * from pg_stat_activity where (state = 'idle in transaction') and xact_start is not null; |
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
import requests | |
import time | |
import json | |
import re | |
root_url = "http://192.168.0.1" | |
base_url = root_url + "/cgi" | |
login_url = base_url + "/login" | |
get_busy_url = base_url + "/getBusy" |
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
import re | |
# Custom grep | |
grep = lambda lib, regex : filter(lambda x : re.search(regex, x), dir(lib)) | |
# Usage | |
# input: list(grep(bson, 'deco')) | |
# result: ['_utf_8_decode', 'decode_all', 'decode_file_iter', 'decode_iter'] | |
# input: list(grep(numpy, '^a.*y$')) | |
# result: ['any', 'array', 'asanyarray', 'asarray', 'ascontiguousarray', 'asfarray', 'asfortranarray'] |
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
import numpy as np | |
import cv2 | |
import os | |
import random | |
import pandas as pd | |
import sys | |
class ImageDataLoader(): | |
def __init__(self, data_path, gt_path, shuffle=False, gt_downsample=False, pre_load=False, num_classes=10): | |
#pre_load: if true, all training and validation images are loaded into CPU RAM for faster processing. |
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
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
from src.network import Conv2d, FC | |
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
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import src.network as network | |
from src.models import CMTL | |
class CrowdCounter(nn.Module): | |
def __init__(self, ce_weights=None): | |
super(CrowdCounter, self).__init__() |
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
import os | |
import torch | |
import numpy as np | |
from src.crowd_count import CrowdCounter | |
from src import network | |
from src.data_loader import ImageDataLoader | |
from src import utils | |
torch.backends.cudnn.enabled = True |
NewerOlder