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
@Insert("INSERT IGNORE INTO t_user " + | |
"(email, password, salt, is_active) " + | |
"VALUES (#{email}, #{password}, #{salt}, 1)") | |
int addUser(TUser user); | |
//重点是 IGNORE |
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.security.SecureRandom; | |
import java.util.Locale; | |
import java.util.Objects; | |
import java.util.Random; | |
public class RandomString { | |
/** | |
* Generate a random string. | |
*/ |
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
<nav class="navbar navbar-light navbar-expand-md navigation-clean-button"> | |
<div data-toggle="collapse" data-target=".navbar-collapse.show" class="container"><router-link class="navbar-brand" to="/">首页</router-link><button class="navbar-toggler" data-toggle="collapse" data-target="#navcol-1"><span class="sr-only">Toggle navigation</span><span class="navbar-toggler-icon"></span></button> | |
<div class="collapse navbar-collapse" | |
id="navcol-1"> | |
<ul class="nav navbar-nav mr-auto"> | |
<li class="nav-item" role="presentation"><router-link class="nav-link" to="/see-other-forum-list">查贴吧</router-link></li> | |
<li class="nav-item" role="presentation"><a class="nav-link" href="#">Second Item</a></li> | |
<li class="dropdown"><a class="dropdown-toggle nav-link dropdown-toggle" data-toggle="dropdown" aria-expanded="false" href="#">Dropdown</a> | |
<div class="dropdown-menu" role="menu"><a class="dropdown-item" role="presentation" href= |
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.io.Serializable; | |
/** | |
* 功能描述:工具类 | |
* | |
* <p> 创建时间:May 14, 2018 7:58:06 PM </p> | |
*/ | |
public class JsonData implements Serializable { | |
/** |
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 com.diaolizhi.mybatisdemo.utils; | |
import com.diaolizhi.mybatisdemo.domain.User; | |
import io.jsonwebtoken.Claims; | |
import io.jsonwebtoken.Jwts; | |
import io.jsonwebtoken.SignatureAlgorithm; | |
import java.util.Date; |
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 chapter3; | |
/** | |
* @program: studythread2 | |
* @description: 懒汉式单例模式 | |
* @author: diaolizhi | |
* @create: 2018-11-13 12:39 | |
**/ | |
public class LazySingleton { |
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 chapter3; | |
/** | |
* @program: studythread2 | |
* @description: synchronized Demo | |
* @author: diaolizhi | |
* @create: 2018-11-13 10:29 | |
**/ | |
public class SynchronizedDemo { |
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
btnFinish.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Intent intentToFinish = new Intent(WizardThree.this, FinishActivity.class); | |
//重点是下面这一句 | |
intentToFinish.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); | |
intentToFinish.putExtra("setting", setting); | |
startActivity(intentToFinish); | |
WizardThree.this.finish(); | |
} |
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
//读 | |
btn1.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Intent intent = new Intent(MainActivity.this, WizardOne.class); | |
intent.putExtra("setting", setting); | |
startActivityForResult(intent, 1); | |
} | |
}); |
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
public Form1() | |
{ | |
//TimerCallback 是委托类型,可以关联一个形参为 Object 的函数 | |
TimerCallback timerCallback = new TimerCallback(timeUpdate); | |
//Timer 每隔 1000ms 调用委托 | |
System.Threading.Timer timer = new System.Threading.Timer(timerCallback, "", 0, 1000); | |
} | |
public void timeUpdate(Object obj) |