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 python3 | |
import time | |
import datetime | |
# change your birthday here | |
my_birthday = datetime.datetime(2000, 1, 1, 00, 00, 00) | |
dt_now = datetime.datetime.now() | |
print(dt_now) | |
print('UNIX timestamp: {}'.format(dt_now.timestamp())) |
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
function timestampToDateStr(timestamp) { | |
var format = 'Y/M/D h:m:s'; | |
var formatArr = ['Y','M','D','h','m','s']; | |
var returnArr = []; | |
var formatNumber = function(n) { | |
n = n.toString(); | |
return n[1] ? n : '0' + n; | |
}; | |
var date = new Date(timestamp * 1000); |
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
# https://stackoverflow.com/questions/343865 | |
def utm_to_lat_lon(zone, easting, northing, northern_hemisphere=True): | |
if not northern_hemisphere: | |
northing = 10000000 - northing | |
a = 6378137 | |
e = 0.081819191 | |
e1sq = 0.006739497 | |
k0 = 0.9996 |
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
#include <iostream> | |
#include <iomanip> | |
#include <fstream> | |
#include <string> | |
#include <sstream> | |
int main(int argc, char **argv) { | |
if (argc != 2) { | |
std::cout << "Usage: ./load_big_ply <filename>\n"; | |
return 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
#include <iostream> | |
#include <thread> | |
#include <chrono> | |
void foo() { | |
std::this_thread::sleep_for(std::chrono::milliseconds(100)); | |
} | |
int main(int argc, char **argv) { | |
auto start_time = std::chrono::high_resolution_clock::now(); |
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
## reference: http://ronny.rest/tutorials/module/pointclouds_01/point_cloud_birdseye/ | |
## https://blog.csdn.net/weixin_39999955/article/details/83819313 | |
import os | |
import sys | |
import numpy as np | |
import pypcd | |
from PIL import Image | |
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 python3 | |
import requests | |
from datetime import datetime | |
TICKER_API_URL = 'https://api.coinmarketcap.com/v1/ticker/' | |
def get_latest_crypto_price(crypto='bitcoin'): | |
return float(requests.get(TICKER_API_URL+crypto).json()[0]['price_usd']) |
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
from matplotlib import pyplot as plt | |
%matplotlib inline | |
from skimage.color import hsv2rgb | |
from skimage.color import rgb2gray | |
from skimage.data import stereo_motorcycle | |
from skimage.registration import optical_flow_tvl1 | |
import numpy as np | |
image0, image1, disp = stereo_motorcycle() |
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
# -*- coding: utf-8 -*- | |
# @Author: insaneyilin | |
# Python version 2.7 | |
# Adapted from | |
# https://github.com/AtsushiSakai/PythonRobotics/tree/master/Localization/histogram_filter | |
import copy | |
import math | |
import matplotlib.pyplot as plt |
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
# -*- coding: utf-8 -*- | |
# @Author: insaneyilin | |
# Python version 2.7 | |
import os | |
import sys | |
import time | |
import argparse | |
import multiprocessing | |
from PIL import Image |