pip install hdfs
from hdfs import InsecureClient
hdfs_client = InsecureClient('http://192.168.0.251:50070',user='hive')
#列出文件
hdfs_client.list('.')
# 新建文件
hdfs_client.makedirs('/a/b/c')
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 | |
import os | |
import json | |
import time | |
import requests | |
from requests.auth import AuthBase | |
from settings import LOGIN_URL, CAPTCHA_URL | |
from config import ( | |
API_VERSION, APP_VERSION, APP_BUILD, UUID, UA, APP_ZA, CLIENT_ID, |
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
# following Python packages needs to be installed | |
# xlrd, xlsxrd, unidecode, MySQLdb | |
import xlrd | |
import xlsxrd | |
import MySQLdb as mdb | |
import re | |
import unidecode |
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 | |
import os,io | |
from flask import Flask, request, redirect, url_for,Response,render_template,send_file,make_response,jsonify,send_from_directory | |
from werkzeug import secure_filename | |
from flask_cors import CORS,cross_origin | |
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) | |
APP_ROOT = os.path.dirname(os.path.abspath(__file__)) | |
UPLOAD_FOLDER = os.path.join(APP_ROOT, 'static\\upload') |
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
``` | |
virt-install \ | |
--virt-type=kvm \ | |
--name=master \ | |
--vcpus=16 \ | |
--memory=16384 \ | |
--location=/home/CentOS-7-x86_64-Everything-1708.iso \ | |
--disk path=/home/vms/master.qcow2,size=2048,format=qcow2 \ | |
--network bridge=br0 \ |
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 bash | |
# # | |
# # Install main dependencies on CentOS: | |
# # Python 3.4.5, CMake 3.10.0, OpenCV 3.3.1 | |
# # Author Andrii Lundiak ([email protected]) | |
# # | |
# https://github.com/ageitgey/face_recognition/issues/191 | |
# https://github.com/opencv/opencv/issues/8471 |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>PC HLS video</title> | |
<link href="http://cdn.bootcss.com/video.js/6.0.0-RC.5/alt/video-js-cdn.min.css" rel="stylesheet"> | |
</head> | |
<body> |
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
# Original source from http://asyncio.readthedocs.io/en/latest/producer_consumer.html | |
# Rewritten for Python >=3.4 | |
import asyncio | |
import random | |
@asyncio.coroutine | |
def produce(queue, n): | |
for x in range(n): |
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
#change pd model to tflite | |
bazel-bin/tensorflow/contrib/lite/toco/toco --input_file=model.pb --input_format=TENSORFLOW_GRAPHDEF --output_format=TFLITE --output_file=/tmp/mobile.tflite --inference_type=FLOAT --inference_input_type=FLOAT --input_arrays=input --output_arrays=Reshape --input_shapes=1,224,224,3 | |
#build apk | |
bazel build -c opt --cxxopt='--std=c++11' //tensorflow/examples/tensorflow-android-speech-kws/android:tensorflow_demo | |
#华为 caffe 模型转换 | |
./cngen_linux --prototxt mobilenet_v2_deploy.prototxt --model mobilenet_v2.caffemodel | |
#华为 tensorflow 模型转换 |
OlderNewer