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
package vtest.bio; | |
import java.io.BufferedReader; | |
import java.io.DataInputStream; | |
import java.io.DataOutputStream; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.net.Socket; | |
public class BioClient { |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<configuration scan="true" scanPeriod="30 seconds" debug="false"> | |
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | |
<layout class="ch.qos.logback.classic.PatternLayout"> | |
<pattern><![CDATA[%d{HH:mm:ss.SSS} %-5level %logger{10}[%method,%line] - %msg%n]]></pattern> | |
</layout> | |
</appender> | |
<appender name="FILE" | |
class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
<encoding>UTF-8</encoding> |
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 java.util.Timer | |
import java.util.TimerTask | |
import scala.concurrent._ | |
/** Create Future[T] instances which will be completed after a delay. | |
*/ | |
object TimedEvent { | |
val timer = new Timer |
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
create user 'newuser'@'localhost' identified by 'password'; | |
create database 'dbname' character set utf8; | |
grant all privileges on dbname.* to 'newuser'@'localhost'; | |
flush privileges; | |
create table TT_RESERVE_TEMPLATE | |
( |
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
[30 天学习 30 种新技术系列](https://segmentfault.com/a/1190000000349384) |
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
@ControllerAdvice | |
public class AdminExceptionHandler { | |
@ExceptionHandler(AdminNotFoundException.class) | |
@ResponseBody | |
public ResponseEntity<ErrorInfo> adminNotFoundException(HttpServletRequest request, AdminNotFoundException e) { | |
String url = request.getRequestURL().toString(); | |
String errorMessage = localizeErrorMessage("error.admin.not.found", new Object[] { e.getAdminId() }); | |
return new ResponseEntity<ErrorInfo>(new ErrorInfo(url, errorMessage), HttpStatus.NOT_FOUND); | |
} |