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.*; | |
import java.util.zip.*; | |
/** | |
*功能:zip压缩、解压 | |
*说明:本程序通过ZipOutputStream和ZipInputStream实现了zip压缩和解压功能. | |
*问题:由于java.util.zip包并不支持汉字,当zip文件中有名字为中文的文件时, | |
* 就会出现异常:"Exception in thread "main " java.lang.IllegalArgumentException | |
* at java.util.zip.ZipInputStream.getUTF8String(ZipInputStream.java:285) | |
*解决: | |
* 方法1、修改import java.util.zip.ZipInputStream和ZipOutputStream. |
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.sql.*; | |
class ConnectAccess{ | |
String connStr; | |
public ConnectAccess(String accessDB_DSN_Name){ | |
//accessDB_DSN_Nameabc为自己创建的系统DSN数据源名,对应一个Access数据库. | |
//String link="jdbc:odbc:driver={Microsoft Access Driver(*.mdb)};DBQ=H:\\summer\\javaxml\\db.mdb"; | |
connStr = "jdbc:odbc:"+accessDB_DSN_Name; | |
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.UUID; | |
public class GenUUID { | |
public static void main(String[] args) { | |
for(int i=0; i<100; i++){ | |
UUID uuid = UUID.randomUUID(); | |
System.out.println (uuid); | |
} |
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.regex.Pattern; | |
import java.util.regex.Matcher; | |
public class AuthCodePhone { | |
public static String parseMsg(String msg) { | |
String sensitive = ""; | |
Pattern p = Pattern.compile(EXP); | |
Matcher m = p.matcher(msg); |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <netinet/in.h> | |
#include <sys/socket.h> | |
#include <unistd.h> | |
int main() | |
{ |
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
#include <iostream> | |
using namespace std; | |
int a[105]; | |
//下标从1开始 | |
void BubbleSort(int a[], int n) | |
{ | |
int i, j; | |
for(i = 1; i < n; i++) | |
{ | |
for(j = 1; j <= n - i; j++) |
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
/* | |
* %W% %E% | |
* | |
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. | |
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. | |
*/ | |
/* | |
* We used part of Netscape's Java Runtime Interface (JRI) as the starting | |
* point of our design and implementation. |
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 static boolean readInnerZipFile(String oriZipFile,String | |
innerZipFileEntryName, String outZipFileEntryName) { | |
ZipFile innerZipFile = null; | |
try { | |
innerZipFile = new ZipFile(oriZipFile); | |
Enumeration entries = innerZipFile.entries(); | |
ZipEntry entryIn = null; | |
while (entries.hasMoreElements()) { | |
ZipEntry entry = entries.nextElement(); | |
// System.out.println(entry); |
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
#!/usr/bin/env python | |
## repo default configuration | |
## | |
from __future__ import print_function | |
REPO_URL = 'https://gerrit.googlesource.com/git-repo' | |
REPO_REV = 'stable' | |
# Copyright (C) 2008 Google Inc. | |
# |
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
System.out.println(new BigInteger(16 * 8, new Random()).toString(16)); |
OlderNewer