自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(16)
  • 资源 (1)
  • 收藏
  • 关注

原创 HashTable和HashMap的原理

昨天看了算法导论对散列表的介绍,今天看了一下Hashtable, HashMap这两个类的源代码,并参考了网上的一些观点,对它们的实现有了大概的理解。原来hashtable里的key-value还是用数组存储的,数组元素是Entry类型,同一数组索引下储存的实质是一个Entry链表,Entry中的next值指向下一个Entry.当把key-value放进hashtable时,会根据key的hash

2012-12-12 14:23:15 501

原创 统计程序的计算时间。

public class Timing    {        TimeSpan duration;        public Timing()        {            duration = new TimeSpan(0);        }        public void StartTime()        {

2012-12-11 11:19:02 465

原创 数据结构-二分查找算法

private static bool BinSearch(int val)        {                       int mid=0;            int lowerBound = 0;            int upperBound=array1.Length-1;            while (low

2012-12-11 11:18:34 626

原创 数据结构-插入排序算法

for (int i = 1; i             {                int curvalue = array[i];                int temp = i;                while (temp > 0 && array[temp - 1] > curvalue)                {

2012-12-11 11:18:04 411

原创 数据结构-选择排序算法

int min, temp, k = 0;            for (int i = 0; i             {                min = array[i];                for (int j = i + 1; j                 {                    if (min > array[j]

2012-12-11 11:17:37 338

原创 数据结构-冒泡排序算法

int temp; int[] arr = new int[] { 1, 3, 8, 4, 5, 7, 10, 12 };           for (int j = 0; j  {      for (int i = arr.Length - 1; i > j; i--)      {             int a = arr[j];

2012-12-11 11:17:03 462

原创 C#实现的洗牌算法

<br />using System; <br />using System.Diagnostics; <br />  <br />namespace Lucifer.CSharp.Sample <br />{ <br />    class Program <br />    { <br />        static void Main(string[] args) <br />        { <br />            //初始化牌局 <br />            int[] ar

2011-04-29 13:20:00 2043

原创 C#控件的闪烁问题解决方法

protected override void WndProc(ref Message m) { if (m.Msg == 0x0014) // 禁掉清除背景消息 return; base.WndProc(ref m); }

2011-04-28 14:03:00 1159

原创 ListView 列添加动态加载图片

1.把动态的GIF图片全部提取出不同的帧图片2.再把这些图片添加到ImageList里3.界面添加个定时器 时间设置为1004.循环加载图片实现图片的切换//SetStyle(ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);listView1.Items[0].ImageIndex = num;            num++; 

2011-04-26 13:59:00 1745

原创 Jquery操作

jquery radio取值,checkbox取值,select取值,radio选中,checkbox选中,select选中,及其相关<br />获取一组radio被选中项的值<br />var item = $('input[@name=items][@checked]').val();<br />获取select被选中项的文本<br />var item = $("select[@name=items] option[@selected]").text();<br />select下拉框的第二个元素为当

2011-04-21 09:08:00 336

原创 Orcale 多用户导入,导出的SQL

<br />导出:<br />exp system/passwd file=myexp.dmp log=myexp.log owner=user1,user2,user3<br /><br />导入:<br />imp system/passwd file=myexp.dmp log=myimp.log fromuser=user1 touser=user1<br />imp system/passwd file=myexp.dmp log=myimp.log fromuser=user2 touser=u

2011-04-21 09:06:00 697

原创 C# 操作Access的公共类

<br /> using System;<br />using System.Collections.Generic;<br />using System.Linq;<br />using System.Text;<br />using System.Data.OleDb;<br />using System.Windows.Forms;<br />using System.Data;<br /><br />namespace Test<br />{<br />    /

2011-04-20 17:01:00 627

原创 .NET网络通信基础(1)

 1.了解Socket   Socket自提出以来一直就是网络应用程序最重要且应用最为广泛的技术 通过Socket概念进行网络联机,可以避免处理切割数据封包、分段传输与数据重组等繁复的细节。 2. 命名空间System.Net.Sockets命名空间主要包括Sockets网络通信应用程序的相关类: ◦Socket类 ◦TCPClient类 ◦TCPListener类 ◦UDPClient类 ◦NetworkStream类 ◦3. Socket类的方法成员 Bind方法  }Accept方法 }Connect

2011-04-17 11:49:00 592

原创 揭开LINQ面纱(1)

1.LINQ操作数组 int[] arr = { 213, 454, 6477, 841, 1, 3, 46, 75, 692, 465, 134, 4156, 123, 456, 789 };            IEnumerable ie = arr.Select(p => p).Where(p => p > 50);            IEnumerator result = ie.GetEnumerator();            while (result.MoveNext())   

2011-04-17 10:43:00 367

原创 Winform模拟登陆网站

对某个网站进行登陆可用HttpWebRequest进行模拟登陆。主要代码如下HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);//根据地址创建个request对象string data = "accountName=" +name+"&password=" + password";//参数srequest.CookieContainer = new CookieContainer();//创建Cookierequest.Metho

2011-04-17 10:11:00 1605

原创 Grid++Report 报表动态使用

<br />1.使用报表设计器添加你要的记录集和标题行/内容行等内容<br />2.加载时 GridppReport _subReport = new GridppReport();创建个报表对象<br />3.<br />创建个构造类<br />  private struct MatchFieldPairType<br />        {<br />            public IGRField grField;<br />            public int MatchColumn

2010-09-01 17:12:00 11724 2

jquery1.5.js

Jquery是继prototype之后又一个优秀的Javascrīpt框架。它是轻量级的js库(压缩后只有21k) ,它兼容CSS3,还兼容各种浏览器 (IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+)

2011-04-20

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除