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
declare | |
i int; | |
now date; | |
date1 date; | |
week int; | |
begin | |
now := trunc(sysdate); | |
for i in 0..2000 loop | |
date1 := now + i; | |
week := to_number(to_char(date1 - 1, 'd')); |
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 class Test { | |
public static void main(String[] args) { | |
Test test = new Test(); | |
System.out.println(test.lpad(10, 23)); | |
} | |
/** | |
* 补齐不足长度 | |
* @param length 长度 | |
* @param number 数字 |
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.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
public class Md5 { | |
public static String toMd5(String arg) { | |
try { | |
MessageDigest md = MessageDigest.getInstance("MD5"); | |
md.update(arg.getBytes()); | |
byte b[] = md.digest(); | |
int i; |
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
//获得访客最近评论数 | |
function get_author_comments_num($email = "") { | |
if(empty($email)) return; | |
$commentsNum = Helper::options()->commentsNum; | |
$time = time() - (24 * 60 * 60 * $commentsNum); //当前时间戳减去30天的时间戳 | |
$db = Typecho_Db::get(); | |
$sql = $db->select('COUNT(mail) as emailnum')->from('table.comments') | |
->where('status = ?','approved') | |
->where('mail = ?',$email) | |
->where('created > ?',$time); |
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.BufferedReader; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.InputStreamReader; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
public class sdf { | |
public static void main(String[] args) { |
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 class FeiQSocket { | |
public static void main(String[] args) throws Exception { | |
List<String> hosts = new ArrayList<String>(); | |
String host = "localhost"; //目标IP | |
int port = 2425; //目标端口,缺省为 2425 | |
InetAddress IPAddress = InetAddress.getByName(host); | |
//String str = "1_lbt4_10#32899#002481627512#0#35807#0:1:Administrators:1D46A2A23307456:288:内容"; //普通消息 | |
String str = "1_lbt4_35#128#0022680C51AC#0#35807#0:1250815230:Administrators:1D46A2A23307456:209:"; //抖屏 | |
byte[] buf = str.getBytes(); |
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.File; | |
import java.util.Iterator; | |
import com.drew.imaging.jpeg.JpegMetadataReader; | |
import com.drew.metadata.Directory; | |
import com.drew.metadata.Metadata; | |
import com.drew.metadata.Tag; | |
import com.drew.metadata.exif.ExifDirectory; | |
/*** | |
* 批量修改目录下图片,根据EXIF信息命名。 |
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.Scanner; | |
public class ReadMinds { | |
public static void main(String[] args) { | |
String result = init(); // 初始化 | |
Scanner scan = new Scanner(System.in); | |
scan.nextLong(); | |
System.out.println(result); | |
} |
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.ArrayList; | |
import java.util.List; | |
import java.util.Scanner; | |
public class Test { | |
/* | |
* 请实现一个函数:凑14; 输入很多个整数(1<=数值<=13); | |
* 任意两个数相加等于14就可以从数组中删除这两个数,求剩余数(按由小到大排列); | |
*/ | |
public static void main(String[] args) { |
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 class Test { | |
public static void main(String[] args) { | |
int[] a = new int[100000000]; | |
for (int i = 0; i < a.length; i++) { | |
a[i] = (int) (Math.random() * 10); | |
} | |
int[] b = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; | |
long start = System.currentTimeMillis(); | |
for (int i = 0; i < a.length; i++) { | |
b[a[i]] += 1; |
OlderNewer