我是从XXX培训中心出来开始的程序员,工作快两年了,确实感到了基础不牢固的影响,所以想重新整理。
希望能温故而知新,这次想把C#和java结合起来学习。就基础而言想了下面的大纲。和大家一起讨论,
欢迎大家贴常用代码或举例说明!也可以补充1.面向对象基础
2.对象,类型(基本类型,值类型与引用类型),成员变量作用域,(二元、三元运算符)
3.类与结构,抽象类与接口,封装继承多态,ref 与 out
4.数组,枚举,集合,泛型。 关于堆栈,队列
5.字符串处理
6.异常,垃圾回收
7.事件委托
8.线程(多线程与线程安全)
9.文件读写(文件流、网络流,字符编码)操作
10.xml[xml读写,序列化/反序列化,]
11.数据库访问
12.网络通信(协议[udp,tcp,ftp,http,sip,pop3]||分布式 com+组件,remoting/web services,ejb/wcf
)
13。多媒体处理操作[图形图像处理,音视频播放]
14.反射
15.本地化与国际化
16.跨平台访问应用,跨语言调用,系统api访问等
17.基础算法(冒泡,排除等常用算法)
希望能温故而知新,这次想把C#和java结合起来学习。就基础而言想了下面的大纲。和大家一起讨论,
欢迎大家贴常用代码或举例说明!也可以补充1.面向对象基础
2.对象,类型(基本类型,值类型与引用类型),成员变量作用域,(二元、三元运算符)
3.类与结构,抽象类与接口,封装继承多态,ref 与 out
4.数组,枚举,集合,泛型。 关于堆栈,队列
5.字符串处理
6.异常,垃圾回收
7.事件委托
8.线程(多线程与线程安全)
9.文件读写(文件流、网络流,字符编码)操作
10.xml[xml读写,序列化/反序列化,]
11.数据库访问
12.网络通信(协议[udp,tcp,ftp,http,sip,pop3]||分布式 com+组件,remoting/web services,ejb/wcf
)
13。多媒体处理操作[图形图像处理,音视频播放]
14.反射
15.本地化与国际化
16.跨平台访问应用,跨语言调用,系统api访问等
17.基础算法(冒泡,排除等常用算法)
/// 判断一个字符串是否符合电子邮箱的规范
/// </summary>
/// <param name="str_Email"></param>
/// <returns></returns>
public bool IsEmail(string str_Email)
{
return System.Text.RegularExpressions.Regex.IsMatch(str_Email, @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9] {1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\)?]$");
}
/// <summary>
/// 判断一个字符串是否符合IP地址的规范
/// </summary>
/// <param name="IP"></param>
/// <returns></returns>
public bool IsIP(string IP)
{
string num = "(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)";
return System.Text.RegularExpressions.Regex.IsMatch(IP, ("^" + num + "\\." + num + "\\." + num + "\\." + num + "$"));
}
/// <summary>
/// 判断一个字符串是否符合URL网址的规范
/// </summary>
/// <param name="str_url"></param>
/// <returns></returns>
public bool IsUrl(string str_url)
{
return System.Text.RegularExpressions.Regex.IsMatch(str_url, @"http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?");
}
/// <summary>
/// 判断一个字符串是否符合大写字母的规范
/// </summary>
/// <param name="str_UpChar"></param>
/// <returns></returns>
public bool IsUpChar(string str_UpChar)
{
return System.Text.RegularExpressions.Regex.IsMatch(str_UpChar, @"^[A-Z]+$");
}
/// <summary>
/// 判断一个字符串是否符合小写字母的规范
/// </summary>
/// <param name="str_UpChar"></param>
/// <returns></returns>
public bool IsLowChar(string str_UpChar)
{
return System.Text.RegularExpressions.Regex.IsMatch(str_UpChar, @"^[a-z]+$");
}
/// <summary>
/// 判断一个字符串是否符合汉字的规范
/// </summary>
/// <param name="str_chinese"></param>
/// <returns></returns>
public bool IsChinese(string str_chinese)
{
return System.Text.RegularExpressions.Regex.IsMatch(str_chinese, @"^[\u4e00-\u9fa5],{0,}$");
}
还有一些框架的东西,struts,ibtatis,jquery等等。
private void RandSort(int[] _num)
{
for (int i = 0; i < _num.Length - 1; i++)
{
Random rd = new Random();
int temp = rd.Next(i,_num.Length);
int tempNum = _num[i];
_num[i] = _num[temp];
_num[temp] = tempNum;
Thread.Sleep(20);
}
}//可扩展为 字符串的
----------------
这个可以到数据结构与算法版去看看:
http://forum.csdn.net/SList/ST_Arithmetic
import java.awt.*;
import java.util.*;public class Top extends Applet implements Runnable {
Font fon[] = new Font[6];
Color col[] = new Color[16];
int xPos, yPos, fNum, cNum; public void init() {
this.setSize(800, 200);
this.setVisible(true);
this.setBackground(Color.orange);
fon[0] = new Font("华文彩云", Font.PLAIN, 30);
fon[1] = new Font("华文彩云", Font.PLAIN, 36);
fon[2] = new Font("华文彩云", Font.PLAIN, 42);
fon[3] = new Font("华文彩云", Font.PLAIN, 25);
fon[4] = new Font("华文彩云", Font.PLAIN, 50);
fon[5] = new Font("华文彩云", Font.PLAIN, 46); col[0] = Color.pink;
col[1] = new Color(100, 33, 189);
col[2] = Color.cyan;
col[3] = Color.cyan;
col[4] = Color.black;
col[5] = Color.cyan;
col[6] = Color.orange;
col[7] = new Color(147, 51, 245);
col[8] = new Color(100, 33, 189);
col[9] = Color.red;
col[10] = Color.red;
col[11] = new Color(245, 145, 100);
col[12] = new Color(110, 154, 154);
col[13] = Color.red;
col[14] = Color.orange;
col[15] = Color.red; xPos = 60;
yPos = 30;
fNum = 0;
cNum = 3;
} public void run() {
// repaint();
} public void paint(Graphics g) {
Random rd = new Random();
g.setColor(col[cNum]);
g.setFont(fon[fNum]);
g.drawString("再渡心灵", xPos, yPos);
try {
fNum = rd.nextInt(5);
Thread.sleep(80);
cNum = rd.nextInt(15);
// cNum=12;
Thread.sleep(80);
xPos = rd.nextInt(610);
Thread.sleep(80);
yPos = rd.nextInt(160);
if (yPos < 40)
yPos = 50;
Thread.sleep(80);
} catch (Exception e) {
System.out.println(e);
}
repaint();
}}
try {
return Double.valueOf(ReadString().trim()).doubleValue();
} catch (Exception e) {
System.out.println(e.toString());
return 0.0;
}
} public static double[] ReadDoubleCollection(int size) {
double[] num = new double[size];
try {
for (int i = 0; i < size; i++) {
num[i] = Double.valueOf(ReadString().trim()).doubleValue();
}
} catch (Exception e) {
System.out.println(e.toString());
}
return num;
} public static String ReadString() {
String string = new String("");
try {
BufferedReader in = new BufferedReader(new InputStreamReader(
System.in));
try {
string = in.readLine();
} catch (Exception e) {
System.out.println(e.toString());
}
} catch (Exception e) {
System.out.println(e.toString());
return string;
}
return string;
} public static String[] ReadStringCollection(int size) {
String[] str = new String[size];
try {
BufferedReader in = new BufferedReader(new InputStreamReader(
System.in));
try {
for (int i = 0; i < size; i++) {
str[i] = in.readLine();
}
} catch (Exception e) {
System.out.println(e.toString());
}
} catch (Exception e) {
System.out.println(e.toString());
}
return str;
} public static int ReadInt() {
try {
return Integer.valueOf(ReadString().trim()).intValue();
} catch (Exception e) {
System.out.println(e.toString());
return 0;
}
} public static int[] ReadIntCollection(int size) {
int[] num = new int[size];
try {
for (int i = 0; i < size; i++) {
num[i] = Integer.valueOf(ReadString().trim()).intValue();
}
} catch (Exception e) {
System.out.println(e.toString());
}
return num;
} public static void WriteLine(String str) {
try {
System.out.println(str);
} catch (Exception e) {
System.out.println(e.toString());
}
} public static void WriteLine(String[] str) {
try {
for (int i = 0; i < str.length; i++) {
System.out.println(str[i]);
}
} catch (Exception e) {
System.out.println(e.toString());
}
} public static void WriteLine(int[] num) {
try {
for (int i = 0; i < num.length; i++) {
System.out.println(num[i]);
}
} catch (Exception e) {
System.out.println(e.toString());
}
} public static void WriteLine(double[] num) {
try {
for (int i = 0; i < num.length; i++) {
System.out.println(num[i]);
}
} catch (Exception e) {
System.out.println(e.toString());
}
}
}
开源框架的研究
就是觉得基础问题不牢,常常出bug影响效率
{
static XmlDocument doc = new XmlDocument(); public static XMLUtil Create(string path)
{
doc.Load(path);
return new XMLUtil();
} public XmlNode GetNode(string xpath)
{
XmlNode node = doc.SelectSingleNode(xpath);
return node;
} public XmlNodeList GetNodeList(string xpath)
{
XmlNodeList nodeList = doc.SelectNodes(xpath);
return nodeList;
}
}
Base64编码
public string EncodeBase64(string code_type,string code)
{
string encode = "";
byte[] bytes = Encoding.GetEncoding(code_type).GetBytes(code);
try
{
encode = Convert.ToBase64String(bytes);
}
catch
{
encode = code;
}
return encode;
}
http://topic.csdn.net/u/20080619/08/dcef3fe2-f95b-4918-8edb-36d48a3d0528.html
.net板块中这类论坛是一个讨论编程的地方。在这种论坛很难学到真正解决基础或者设计、管理方面的问题的技术。基础不牢跟重复出现bug问题其实并不非常相关。项目管理问题属于软件工程技术范畴(而不是有些人说的行政管理范畴)。可惜csdn的软件工程论坛是很冷清的,那里看不到多少实用的东西。所以我有时候去javaeye来关注与软件工程有关的问题。