首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java面试 >

201314共享三年编程学习资料

2013-01-23 
201314共享3年编程学习资料LZ借着这个大家正着读都认为很牛B,倒着读一死一伤的日子里,我共享下部分我大学

201314共享3年编程学习资料
LZ
    借着这个大家正着读都认为很牛B,倒着读一死一伤的日子里,我共享下部分我大学期间自学编程的一些资料。大学里我不是能得奖学金的人,也不是领导前的红人,但是往往能会写代码的将来能找到工作往往不是那些能得奖学金又是红人的人。所以希望正在大学奋斗学习的人,要选择好自己的目标,知道要学些什么。大学里:什么都可以不及格,但是 做人 不能挂科。相信你懂我说的。下面说共享的资料都是初学者学习使用的,等都学的入门后,就会接触更高一层的东西了。

JAVA 
1、视频资料
尚学堂--马士兵(下载)
传智播客--韩顺平(下载)
2、书籍下载
java核心技术(下载)
think in java(下载)
跟我学spring3(1-7).pdf
23种设计模式书籍下载
JavaGenericsFAQ.pdf
3、题库练习
进去练习下(链接)


WEB
1、视频资料
*在上面给的链接里都能下载
2、知识列表
html、xml、html5
div+css
js+dom
jq(1.8最新)、dojo
extjs
ajax
ps
flash
flex
3、书籍下载
javascript.pdf
w3c
jq华丽网页版本api
ajax异步链接
jq1.4 1.7 1.8文档和js文件下载

数据库mysql oracle 
1、视频下载
*在第一个链接里都有
2、书籍下载
oracle11g.pdf
oracle学习文档
jsp oracle数据库分页
oracle创建表空间、创建用户、授权、夺权、删除用户、删除表空间 
oracle正则使用
oracle存储过程分页处理
====================
以上共享资料都是初学者,慢慢就会接触到东西,当然还有很多其他实际问题。
1、正则


//汉字范围u4E00-u9FA5

import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class sxtRegex01 {

public static void main(String[] args) {

p("检查是否匹配:"+"abc".matches("..."));

p("替换字符串:"+"abc123aa".replaceAll("\\d", "."));

Pattern p = Pattern.compile("[a-z]{3}");
Matcher m = p.matcher("fgha");
p("Pattern+Matcher方法验证匹配:"+m.matches());

p("------------------");

p("a".matches("[abc]"));
p("a".matches("[^abc]"));
p("A".matches("[a-zA-Z]"));
p("A".matches("[a-z]|[A-Z]"));
p("A".matches("[a-z(A-Z)]"));
p("R".matches("[A-Z&&(RFG)]"));

p("------------------");

p("a_8".matches("\\w{3}"));
p("\".matches("\\\"));

p("------------------");

p("hello sir".matches("h.*"));
p("hello sir".matches(".*ir$"));
p("hello sir".matches("^h[a-z]{1,3}o\\b.*"));//匹配单词边界,单词边界是空格出现的位置用\\b匹配
p("hellosir".matches("^h[a-z]{1,3}o\\b.*"));
p(" \n".matches("^[\\s&&[^\\n]]*\\n$"));//开头是一个空格,且不能是换行符,最后必须是换行
    
p("------------------");

Pattern p2 = Pattern.compile("\\d{3,5}");
String s = "123-4536-89789-000";
Matcher m2 = p2.matcher(s);

p(m2.matches());
m2.reset();//把吃进去的字符吐出来重新匹配,否经过m2.matches会吃进去字符 下面的匹配就不成功
p(m2.find());
p(m2.start()+"-"+m2.end());//找到了 就把首位位置打印下(必须找到才能打印)
p(m2.find());
p(m2.start()+"-"+m2.end());
p(m2.find());
p(m2.start()+"-"+m2.end());
p(m2.find());

p(m2.lookingAt());//每次都是才头上开始找

p("------------------");

Pattern p3 = Pattern.compile("java",Pattern.CASE_INSENSITIVE);//加属性后,Patter.CASE_INSENSITIVE表示大小写不管
Matcher m3 = p3.matcher("java_Java_jAva_jAVa_IloveJava");
p(m3.replaceAll("JAVA"));//把所有的都替换为大写的

p("------------------按照单双数替换");
Pattern p4 = Pattern.compile("java",Pattern.CASE_INSENSITIVE);//加属性后,Patter.CASE_INSENSITIVE表示大小写不管
Matcher m4 = p4.matcher("java_Java_jAva_jAVa_IloveJava fdasfas");

StringBuffer sb = new StringBuffer();
int i = 0;
while(m4.find()){
i ++;
if(i%2 == 0){
m4.appendReplacement(sb, "java");
}else{
m4.appendReplacement(sb, "JAVA");
}
}
m4.appendTail(sb);//把尾巴在再添加到buf上既是sb
p(sb);

p("------------------分组加括号只取数字一组");


Pattern p5 = Pattern.compile("(\\d{3,5})([a-z]{2})");
Matcher m5 = p5.matcher("123bb_78987dd_090po");

while(m5.find()){
p(m5.group(1));//grop括号里面第0组是整体,第一组是左起第一个括号,第二组是左起第二个括号
}

p("------------------贪婪的匹配与不贪婪匹配");
Pattern p6 = Pattern.compile("(.{3,10}?)[0-9]");//.{3,10}后面没问号就是贪婪匹配会陪到最长,如果{3,10}?加?号就是懒蛋匹配之匹配最少的,从3个开始找
Matcher m6 = p6.matcher("aaaa5dddd8");
while(m6.find()){//如果这里用if(m6.find)(){p(m6.start()+"-"+m6.end());}  那么之匹配第一个
p(m6.start()+"-"+m6.end());
}

p("------------------普通捕获");
Pattern p7 = Pattern.compile(".{3}");
Matcher m7 = p7.matcher("ab4dd5");
while(m7.find()){
p(m7.group());
}

p("------------------非捕获组");
Pattern p8 = Pattern.compile(".{3}(?=a)");//(?=a)这个是非捕获组的意思,最后一个是a而且还不把这个a取出来!!(?=a)这个要是写在前面 就不一样了
Matcher m8 = p8.matcher("ab4add5");
while(m8.find()){
p("后面不能是a的"+m8.group());
}

p8 = Pattern.compile("(?!a).{3}");//(?!a)前面不能是a的
m8 = p8.matcher("abbsab89");
while(m8.find()){
p("前面不能是a的"+m8.group());
}

//(?<!a)从后往前数 不是a的
//(?<=a)从后往前数 是a的
p("------------------去除><号匹配");
Pattern p9 = Pattern.compile("(?!>).+(?=<)");
Matcher m9 = p9.matcher(">编程中国<");
while(m9.find()){
p(m9.group());
}

p("------------------向前引用");
Pattern p10 = Pattern.compile("(\\d\\d)\\1");//这里面的1是向前引用,12是第一匹配到的,下一次在匹配出来12和前面相同 所以是true
Matcher m10 = p10.matcher("1212");
p(m10.matches());

p("------------------忽略大小写,正则内嵌");//(?i)非捕获组里面这个表示忽略大小写
p("java".matches("(?i)JAVA"));
}

public static void p(Object o){
System.out.println(o);
}
}


2、java汉字转拼音


public class T {

public static void main(String[] args) throws BadHanyuPinyinOutputFormatCombination {

char[] ch = "平淡".toCharArray();

HanyuPinyinOutputFormat t3 = new HanyuPinyinOutputFormat();

/**
 * 拼音大小写类型
 */
//t3.setCaseType(HanyuPinyinCaseType.LOWERCASE);//小写拼音
//t3.setCaseType(HanyuPinyinCaseType.UPPERCASE);//大写拼音

/**
 * 拼音输出方式
 */
//t3.setToneType(HanyuPinyinToneType.WITHOUT_TONE);//不输出语气,就是几声
t3.setToneType(HanyuPinyinToneType.WITH_TONE_NUMBER);//数字方式输出几声
//t3.setToneType(HanyuPinyinToneType.WITH_TONE_MARK);//符号方式的输出几声

/**
 * 拼音字母样式
 */
//The option indicates that the output of 'ü' is "v"
//t3.setVCharType(HanyuPinyinVCharType.WITH_V);

//The option indicates that the output of 'ü' is "ü" in Unicode form
//t3.setVCharType(HanyuPinyinVCharType.WITH_U_AND_COLON);

//The option indicates that the output of 'ü' is "u:"
//t3.setVCharType(HanyuPinyinVCharType.WITH_U_UNICODE);

System.out.println(ch);

//不加样式
String[] pinyinHead = PinyinHelper.toHanyuPinyinStringArray(ch[0]);
for(String str:pinyinHead){
System.out.println(str);
}

//加样式
pinyinHead = PinyinHelper.toHanyuPinyinStringArray(ch[1],t3);
for(String str:pinyinHead){
System.out.println(str);


}
}

}


3、二维码图片生成与解析
  
  public class QRCode {
     private static final int BLACK = 0xff000000;
     private static final int WHITE = 0xFFFFFFFF;
 
     /**
      * @param args
      */
     public static void main(String[] args) {
         QRCode test = new QRCode();
         File file = new File("C:\\Documents and Settings\\Administrator\\桌面\\test.png");
         test.encode("东软帝国", file, BarcodeFormat.QR_CODE, 200, 200, null);
         test.decode(file);
              
     }
 
    public void encode(String contents, File file, BarcodeFormat format, int width, int height, Map<EncodeHintType, ?> hints) {
         try {
             BitMatrix bitMatrix = new MultiFormatWriter().encode(contents, format, width, height);
             writeToFile(bitMatrix, "png", file);
         } catch (Exception e) {
             e.printStackTrace();
         }
     }
 
    public static void writeToFile(BitMatrix matrix, String format, File file) throws IOException {
         BufferedImage image = toBufferedImage(matrix);
         ImageIO.write(image, format, file);
     }
 
     public static BufferedImage toBufferedImage(BitMatrix matrix) {
         int width = matrix.getWidth();
         int height = matrix.getHeight();
         BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
         for (int x = 0; x < width; x++) {
             for (int y = 0; y < height; y++) {
                 image.setRGB(x, y, matrix.get(x, y) == true ? BLACK : WHITE);
             }
         }
         return image;
     }
 
     /**
      * 解析QRCode二维码


      */
     @SuppressWarnings("unchecked")
     public void decode(File file) {
         try {
             BufferedImage image;
             try {
                 image = ImageIO.read(file);
                 if (image == null) {
                     System.out.println("Could not decode image");
                 }
                 LuminanceSource source = new BufferedImageLuminanceSource(image);
                 BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
                 Result result;
                 @SuppressWarnings("rawtypes")
                 Hashtable hints = new Hashtable();
                 //解码设置编码方式为:utf-8
                 hints.put(DecodeHintType.CHARACTER_SET, "UTF-8");
                 result = new MultiFormatReader().decode(bitmap, hints);
                 String resultStr = result.getText();
                 resultStr = new String(resultStr.getBytes("UTF-8"),"GB2312");
                 System.out.println("解析后内容:" + resultStr);
             } catch (IOException ioe) {
                 System.out.println(ioe.toString());
             } catch (ReaderException re) {
                 System.out.println(re.toString());
             }
         } catch (Exception ex) {
             System.out.println(ex.toString());
         }
     }
 }


4、等等很多很多java的东西
===================
我是一直喜欢编程写代码的人,因此有很多一样的人,有时候我们自嘲我们是码农,不过写出来代码代码的兴奋是不能每个人都理解的。希望更多人能和我一起学习,我的群号5307397百度直接输入东软帝国会有我们的贴吧。希望更多人,加入我们一起学习。 java

编程
[解决办法]
好多东西.值得学习.果断mark
[解决办法]
hehe,mark一下咯。有时间可以看看。话说最近想买设计模式的书来看看。随便买那本java解惑的,具体是谁写的呢,什么出版社的,打算买了。。。。
[解决办法]
mark 正则部分精彩
[解决办法]
mark 需要的时候可以拿出来看看
[解决办法]
感谢楼主分享
[解决办法]
好东西 帮顶了
[解决办法]
先不说你的资料是否有用,就凭你能公开资料这点,就值得肯定。顶
[解决办法]
201314共享三年编程学习资料
[解决办法]
201314共享三年编程学习资料

热点排行