Installation
gem install rmagick # you'll need ImageMagick & Ruby first
gem install colormath
gem install micro-optparse
set -e | |
# go somewhere safe | |
cd /tmp | |
# get the source to base APR 1.5.2 | |
curl -L -O http://archive.apache.org/dist/apr/apr-1.5.2.tar.gz | |
# extract it and go into the source | |
tar -xzvf apr-1.5.2.tar.gz |
#!/usr/bin/env python | |
# encoding: utf-8 | |
from worker import add | |
# add.apply_async((1, ), priority=1) | |
# add.apply_async((1, ), priority=1) | |
add.apply_async((7, ), priority=7) | |
add.apply_async((6, ), priority=6) | |
add.apply_async((5, ), priority=5) | |
add.apply_async((8, ), priority=8) |
# Do not excute the script directly. It is just for demonstration. | |
# If you followed the documentation and got the errors below, please take a look at this guide. | |
# Color management: using fallback mode for management | |
# bpy: couldnt find 'scripts/modules', blender probably wont start. | |
# Freestyle: couldn't find 'scripts/freestyle/modules', Freestyle won't work properly. | |
# ImportError: No module named 'bpy_types' | |
# ImportError: No module named 'bpy_types' | |
# pyrna_srna_ExternalType: failed to find 'bpy_types' module | |
# ImportError: No module named 'bpy_types' |
# @Author: xiewenqian <int> | |
# @Date: 2016-11-28T20:35:09+08:00 | |
# @Email: wixb50@gmail.com | |
# @Last modified by: int | |
# @Last modified time: 2016-12-01T19:32:48+08:00 | |
import pandas as pd | |
from pymongo import MongoClient |
# 邪魔歪道之使用OpenCV精准切割视频 | |
## ffmpeg 切割视频 | |
使用ffmpeg直接切割视频的命令 | |
``` | |
ffmpeg -i test.mp4 -ss 00:00:00 -t 00:00:30 -c:v copy -c:a copy output.mp4 | |
``` | |
或者 | |
``` |
#! /bin/bash | |
in=$1 | |
if [ -z "$in" ] | |
then | |
in=$(cat -) | |
fi | |
if [ -z "$in" ] |
const str1 = 'This is an example to test cosine similarity between two strings'; | |
const str2 = 'This example is testing cosine similatiry for given two strings'; | |
// | |
// Preprocess strings and combine words to a unique collection | |
// | |
const str1Words = str1.trim().split(' ').map(omitPunctuations).map(toLowercase); | |
const str2Words = str2.trim().split(' ').map(omitPunctuations).map(toLowercase); | |
const allWordsUnique = Array.from(new Set(str1Words.concat(str2Words))); |
import tensorflow as tf | |
import numpy as np | |
################################################################################## | |
# Initialization | |
################################################################################## | |
# Xavier : tf.contrib.layers.xavier_initializer() | |
# He : tf.contrib.layers.variance_scaling_initializer() | |
# Normal : tf.random_normal_initializer(mean=0.0, stddev=0.02) |
class ALG(object): | |
def __init__(self,list): | |
self.list=list | |
#冒泡 | |
def bubble_sort(nums): | |
n =len(nums) | |
for i in range(n - 1): | |
for j in range(n-1 - i): | |
if nums[j+1] < nums[j]: | |
nums[j], nums[j + 1] = nums[j + 1], nums[j] |