Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBlandy committed Feb 4, 2021
1 parent 8bd24d4 commit 94efb9b
Show file tree
Hide file tree
Showing 15 changed files with 122 additions and 2 deletions.
Empty file added FFmpeg/FFmpeg-编译.java
Empty file.
10 changes: 10 additions & 0 deletions FFmpeg/FFmpeg.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@

ffprobe.exe
* 用于查看文件格式的应用程序


# 模块组成
AVFormat
AVCodec
AVFilter
AVDevice
AVUtil
swresample
swscale

---------------------------
FFmpeg - 音视频处理流程
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions Go/lib/bufio.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type

func NewReader(rd io.Reader) *Reader
func NewReaderSize(rd io.Reader, size int) *Reader
* 默认的size是: defaultBufSize = 4096

func (b *Reader) Buffered() int
func (b *Reader) Discard(n int) (discarded int, err error)
Expand Down
34 changes: 34 additions & 0 deletions 设计模式/设计模式-命令模式.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-------------------------------
命令模式
-------------------------------
# 命令模式
// 命令接口
interface Command {
void execute();
}
class Car implements Command{ // 车
public void run() {
System.out.println("car is runing...");
}
@Override
public void execute() {
this.run();
}
}

class Control { // 控制器
private Command command;
public Control(Command command) {
this.command = command;
}
public void control() {
this.command.execute();
}
}

public class Main {
public static void main(String[] args) throws InterruptedException {
Control control = new Control(new Car());
control.control(); // car is runing...
}
}
8 changes: 7 additions & 1 deletion 设计模式/设计模式-工厂.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,10 @@ public static Car getCar(String name) {
---------------------
工厂模式-抽象工厂 |
---------------------
* 把所有的组件都抽象,工厂化
* 把所有的组件都抽象,工厂化
* 例如把用户的所有组件”,都通过工厂来获得
public interface User {
getName();
getAge();
getGender();
}
71 changes: 70 additions & 1 deletion 设计模式/设计模式-装饰者.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,73 @@
----------------------------
装饰者设计模式 |
----------------------------
* 没啥好说的,简单
# 没啥好说的,简单
abstract class Beverage {
// 饮料
private static final String defaultName = "unknow";
public String getName() {
return defaultName;
}
abstract int cost();
}
abstract class CondimentDecorator extends Beverage { // 调料
public abstract String getName();
}

class Coffee extends Beverage { // 咖啡
@Override
public String getName() {
return "咖啡";
}
@Override
public int cost() {
return 15;
}
}
class Cola extends Beverage { // 可乐
@Override
public String getName() {
return "可乐";
}
@Override
public int cost() {
return 10;
}
}
class Coriander extends CondimentDecorator { // 香菜
private Beverage beverage;
public Coriander(Beverage beverage) {
this.beverage = beverage;
}
@Override
public String getName() {
return "香菜";
}
@Override
public int cost() {
return 2 + this.beverage.cost();
}
}
class Mustard extends CondimentDecorator { // 芥末
private Beverage beverage;
public Mustard(Beverage beverage) {
this.beverage = beverage;
}
@Override
public String getName() {
return "芥末";
}
@Override
public int cost() {
return 1 + this.beverage.cost();
}
}
public class Main {
public static void main(String[] args) throws InterruptedException {
Beverage beverage = new Coffee(); // 咖啡
beverage = new Coriander(beverage); // 加 香菜
beverage = new Mustard(beverage); // 加 芥末
System.out.println(beverage.cost()); // 18块钱
}
}

0 comments on commit 94efb9b

Please sign in to comment.