Justin's Words


  • Home

  • About

  • Archives
Justin's Words

FFmpeg 备忘录

Posted on 2015-06-05 | In Linux |

安装 FFmpeg,直奔官网。

将 gif 转为 mp4

Twitter 宣布支持 gif 图片,它其实是将 gif 转为 mp4 再通过 <video> 标签展示的,这样的好处有:

  • 不必等全部资源加载完成再进行展示
  • gif 文件转为 mp4 格式后,文件大小差别相当大,gif 大小为 2MB,转为 mp4 大小为 260KB
  • 可以对动画进行播放、暂停、拖曳控制
Read more »
Justin's Words

Java Iterator and ListIterator

Posted on 2015-06-04 | In Java |

本文包含的 ArrayList 用法可在上篇文章找到,先上代码:

Read more »
Justin's Words

Java ArrayList

Posted on 2015-06-04 | In Java |

先来一段代码:

Read more »
Justin's Words

XMLHttpRequest FormData

Posted on 2015-06-04 | In Front-End |

What is FormData

MDN

XMLHttpRequest Level 2 adds support for the new FormData interface. FormData objects provide a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest send() method.

Read more »
Justin's Words

Android actionbar 笔记

Posted on 2015-05-31 | In Android |

按照 Android Studio 内置的例子做了个 actionbar 的 Demo,现在写下来做笔记,IDE 为 Android Studio v1.2。 完成的截图如下:

Read more »
Justin's Words

Transfer decimal number to binary number

Posted on 2015-05-21 | In Algorithm |

Transfer decimal number to its corresponding binary number in a quick way.

Read more »
Justin's Words

Insertion Sort 插入排序

Posted on 2015-05-20 | In Algorithm |

来一个直观的图解释插入排序(图来自 Insertion Sort):

Insertion Sort

Read more »
Justin's Words

正则零宽断言

Posted on 2015-05-17 | In Python |

今天下载了个字幕文件,不过里面的分行太多,明明只是简单的一个不长句子,硬是被分成两行,于是我决定把这些分行全部去掉,字幕文件部分片段如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
00:01:15,452 --> 00:01:18,843
This is Zero One Alpha. We
have secured the Falcon.
3
00:01:18,868 --> 00:01:21,476
I say again,We have
secured the Falcon.

4
00:01:22,952 --> 00:01:26,452
I will count from one to ten. Within
that you'll tell me what I wanna know.

5
00:01:27,052 --> 00:01:28,752
Otherwise,

6
00:01:29,177 --> 00:01:32,152
<span style="color: #00ff00;">the number ten is
the last thing you'll hear.
Read more »
Justin's Words

Tower of Hanoi Algorithm

Posted on 2015-05-17 | In Algorithm |

What exactly is the Tower of Hanoi, here is the explanation from Tower of Hanoi:

The Tower of Hanoi is a mathematical game or puzzle. It consists of three rods, and a number of disks of different sizes which can slide onto any rod. The puzzle starts with the disks in a neat stack in ascending order of size on one rod, the smallest at the top, thus making a conical shape.

The objective of the puzzle is to move the entire stack to another rod, obeying the following simple rules:

  1. Only one disk can be moved at a time.
  2. Each move consists of taking the upper disk from one of the stacks and placing it on top of another stack i.e. a disk can only be moved if it is the uppermost disk on a stack.
  3. No disk may be placed on top of a smaller disk.
Read more »
Justin's Words

斐波那契数(Fibonacci)

Posted on 2015-05-16 | In Algorithm |

来自维基百科的定义:

斐波那契數的特點是每一個數都是前二個數的和。頭二項是0和1,此數列的前幾項如下: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987…

Read more »
1…345…11
Justin Young

Justin Young

You Deserve A Better Life

107 posts
15 categories
54 tags
RSS
Github Twitter
© 2014 - 2019 Justin Young
Powered by Hexo
Theme - NexT.Mist