View UrlShortener.java
public class UrlShortener {
// private static final String ALPHABET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
private static final String ALPHABET = "mUSNcOa6hDgfnEJ1rGMPC03jv4k9RIqL2Yy7TQdH8xu5XFWwAKoZVstizlepBb";
private static final int BASE = ALPHABET.length();
public static String encode(int num) {
StringBuilder sb = new StringBuilder();
while (num > 0) {
sb.append(ALPHABET.charAt(num % BASE));
View UUIDUtil.java
import java.nio.ByteBuffer;
import java.util.Base64;
import java.util.UUID;
public class UUIDUtil {
public static String shortUUID() {
UUID uuid = UUID.randomUUID();
return shortUUID(uuid);
}
View DataConvertionUtil.java
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Iterator;
import org.apache.poi.hssf.usermodel.HSSFCell;
View Demo.java
import java.util.function.Function;
/**
* @author biezhi
* @date 2018/5/12
*/
public class Demo {
public Function<String, Class> loader() {
return Unchecked.function(Class::forName);
View mysql_back.sh
#!/bin/sh
#this is the prefix before the filename and can be anything you want
fileprefix='mysql_backup_';
#this is your mysql user - best to create a new mysql user called backup that has access to all databases
myuser='backup';
#your mysql password
mypass='s0mething$ecure123';
View AsciiArt.java
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
public class AsciiArt {
public void drawString(String text, String artChar, Settings settings) {
View email.go
package main
import (
"crypto/tls"
"fmt"
"log"
"net"
"net/smtp"
)
View ffmpeg常用操作.md

提取音频

ffmpeg -i a.mp4 -f mp3 -vn a.mp3

提取视频

ffmpeg -i a.mp4 -vcodec copy -an b.mp4
View ffmpeg.md

使用ffmpeg合并MP4文件

ffmpeg -i "Apache Sqoop Tutorial Part 1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "Apache Sqoop Tutorial Part 2.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "Apache Sqoop Tutorial Part 3.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts
ffmpeg -i "Apache Sqoop Tutorial Part 4.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate4.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts|intermediate4.ts" -c copy -bsf:a aac_adtstoasc "Apache Sqoop Tutorial.mp4"