- Enviroment
- Ubuntu 20.04
- Intellij IDEA 2020
This file contains hidden or 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
Tomcat tomcat = .... | |
final Connector nioConnector = new Connector(Http11NioProtocol.class.getName()); | |
nioConnector.setPort(58090); | |
nioConnector.setSecure(false); | |
nioConnector.setScheme("http"); | |
nioConnector.setProtocol("HTTP/1.1"); | |
try { | |
nioConnector.setProperty("address", InetAddress.getByName("localhost").getHostAddress()); |
This file contains hidden or 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
package com.liquable.nemo.model; | |
import static java.util.Arrays.asList; | |
import static java.util.stream.Collectors.groupingBy; | |
import static java.util.stream.Collectors.summingLong; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Map.Entry; |
This file contains hidden or 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
<fontconfig> | |
<match target="pattern"> | |
<test qual="any" name="family"> | |
<string>serif</string> | |
</test> | |
<edit name="family" mode="prepend" binding="strong"> | |
<string>Noto Sans T Chinese</string> | |
<string>Noto Sans S Chinese</string> | |
<string>Noto Sans Japanese</string> | |
<string>Noto Sans Korean</string> |
This file contains hidden or 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
protobuf | |
protobuf-2.6.1 | |
protobuf-master |
This file contains hidden or 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
// good for unit test | |
public static int scanAvailablePort() throws IOException { | |
try (ServerSocket serverSocket = new ServerSocket(0)) { | |
return serverSocket.getLocalPort(); | |
} | |
} |
This file contains hidden or 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
### Full command line options | |
``` | |
ffmpeg -f gif -i FOO.gif -pix_fmt yuv420p -c:v libx264 -movflags +faststart -filter:v crop='floor(in_w/2)*2:floor(in_h/2)*2' BAR.mp4 | |
``` | |
### Notie | |
* output mp4 is encoded with h264, support Firefox/Chrome/Safari in Windows, Mac OSX, Android, and iOS. |
This file contains hidden or 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
// ==UserScript== | |
// @name ptt hjkl keyboard | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description right hand keyboard to navigate term.ptt.cc | |
// @author Ingram Chen | |
// @match https://term.ptt.cc/ | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=ptt.cc | |
// @grant none | |
// ==/UserScript== |
一個傳統 Java Spring 的應用程式會分為三層 @Controller
@Service
@Repository
,然後依據組織需求,再往下細分。
比方說 Service 層複雜的話,會增加 Gateway、Facade 層,或是我們組織獨有的 CoreService 層
另一個層級大部份 Java 組織會忽略的是 Domain Model 層,絕大多數 Java 開發者會開個 entity 或 model package,然後 將所有的 Entity 往裡面丟。然而該 Entity 只是一堆欄位和 getter/setter 的堆疊,也就是單純的 Table 的對應物件而已, 不具備任何 business logic