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
/*! | |
* \file format_converter.h | |
* | |
* \author cltian | |
* \date 11 2020 | |
* | |
* | |
*/ | |
extern "C" { | |
#include "libavcodec/avcodec.h" |
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
#! /bin/bash | |
baseDir=$(cd `dirname "$0"`;pwd) | |
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return | |
mkdir $baseDir/icons.iconset | |
sips -z 16 16 pic.png --out $baseDir/icons.iconset/icon_16x16.png | |
sips -z 32 32 pic.png --out $baseDir/icons.iconset/[email protected] | |
sips -z 32 32 pic.png --out $baseDir/icons.iconset/icon_32x32.png | |
sips -z 64 64 pic.png --out $baseDir/icons.iconset/[email protected] | |
sips -z 64 64 pic.png --out $baseDir/icons.iconset/icon_64x64.png | |
sips -z 128 128 pic.png --out $baseDir/icons.iconset/[email protected] |
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
#!/bin/bash | |
## get files in current dir | |
path=$(dirname·$0) | |
files=$(ls·$path) | |
for·filename·in·$files | |
do | |
echo $filename >> abc | |
done | |
## remove |
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
ffmpeg [global_options] {[input_file_options] -i input_url} ... {[output_file_options] output_url} ... | |
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options | |
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full. | |
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}… | |
Getting help: | |
-h — print basic options |
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
//asynchronous | |
function logWord(word) { | |
setTimeout( | |
function() { | |
console.log(word); | |
}, | |
Math.floor(Math.random() * 100) + 1 | |
// return value between 1 ~ 100 | |
); | |
} |
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 redis | |
class RedisQueue(object): | |
"""Simple Queue with Redis Backend""" | |
def __init__(self, name, namespace='queue', **redis_kwargs): | |
"""The default connection parameters are: host='localhost', port=6379, db=0""" | |
self.__db = redis.Redis(**redis_kwargs) | |
self.key = '%s:%s' % (namespace, name) |
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 file=dir_natural(path) | |
%%% Example: | |
% file=sortObj('./img/*.bmp*'); | |
file=dir(path); | |
for i=1:length(file) | |
A{i}=file(i).name; | |
end | |
[~, ind]=natsort(A); | |
for j=1:length(file) | |
files(j)=file(ind(j)); |
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
digraph G { | |
rankdir="LR"; | |
subgraph cluster_3{ | |
subgraph cluster_2 { | |
style=filled; | |
color=lightgrey; | |
node [style=filled,color=white]; | |
VS -> "top-K"->"sequential \n embeding" | |
label = "CWSE"; |
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
#! /bin/bash | |
# constants definition | |
baseDir=$(cd `dirname "$0"`;pwd) #返回文件当路径 | |
home=$baseDir/.. | |
registry=abc.com | |
name=$registry/dev | |
# functions | |
funWithReturn(){ |
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
''' | |
numpy sinusoid position encoding of Transformer model. | |
params: | |
n_position(n):number of positions | |
d_hid(m): dimension of embedding vector | |
padding_idx:set 0 dimension | |
return: | |
sinusoid_table(n*m):numpy array |
NewerOlder