- 博客(20)
- 资源 (10)
- 收藏
- 关注
原创 构造堆栈:Private List Can Be Converted To Stacklist
// stack.cpp : Defines the entry point for the console application.//#include "stdafx.h"#includeusing namespace std;class node{ friend class list;private: node* next; int data;public: node(node* n
2010-03-12 16:31:00 325
原创 重载String:Overload String
#include "stdafx.h"#include #include using namespace std;class String{private: char* ch; int size;public: String(char *s=""); String(const String &s); ~String(void); int length(void)const; String su
2010-03-12 16:26:00 366
原创 重载操作符:Array:Overload Operator
#include "stdafx.h"#include #include using namespace std;class Array{private : int size; int low; int high; int *arr;public: Array(int sz=10); Array(int l,int h); Array(const Array &a); ~Array(void);
2010-03-12 16:22:00 316
原创 同步对象:Monitor
using System;using System.Threading;public class Cell{ int cellContents; bool readerFlag = false; public int ReadFromCell() { lock (this) { if (!readerFlag)
2010-03-12 16:17:00 251
原创 送花之手动重设:Send Flower:Set A Signal of Ending
using System;using System.Threading;public class TestMain{ private static ManualResetEvent ent = new ManualResetEvent(false); public static void Main() { Boy sender = new Boy
2010-03-12 16:11:00 343
原创 送花同步:AutoResetEvent=ManualResetEvent(Set+Reset)
using System;using System.Threading;public class TestMain{ private static AutoResetEvent ent = new AutoResetEvent(false); public static void Main() { Boy sender = new Boy(ent);
2010-03-12 16:08:00 420
原创 读写同步:AutoResetEvent:ReadThread After WriteThread
using System;using System.Threading;namespace AutoResetEvent_Examples{ class MyMainClass { const int numIterations = 10; static AutoResetEvent myResetEvent = new AutoResetEvent(f
2010-03-12 15:57:00 306
原创 银行账户锁:Transaction:Lock(this)
using System;using System.Threading;namespace ThreadSimple{ internal class Account { int balance; Random r = new Random(); internal Account(int initial) {
2010-03-12 15:36:00 345
原创 信号量:Semaphore:Release
using System;using System.Threading;public class Example{ private static Semaphore _pool; private static int _padding; public static void Main() { _pool = new Se
2010-03-12 15:31:00 378
原创 跨线程调用:Cross Thead Calls are not safe
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Threading;
2010-03-12 11:33:00 260
原创 多线程计算:ThreadPool:Set and Reset
using System;using System.Threading;class CalculateTest{ static void Main() { Calculate calc = new Calculate(); Console.WriteLine("Result = {0}.", calc.Result(55).ToStri
2010-03-12 11:31:00 429
原创 哲学家问题之死锁:A Difficult Philosopher Problem
using System;using System.Threading;public class philosopher_dining{ private static Semaphore[] self = new Semaphore[5]; //number of chopsticks per pholosophor private static Semaphore preven
2010-03-12 11:27:00 334
原创 乒乓球锁:Lock an Object:Switch Different Functions
using System.Threading;public class Program{ static object ball = new object(); public static void Main() { Thread threadPing = new Thread(ThreadPingProc); Thread threadPong = n
2010-03-12 11:25:00 356
原创 读Excel:Reading excel in a ListBox
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Reflection; using System.Linq;using System.Text;using System.Windows.Forms
2010-03-12 11:22:00 386
原创 C++多线程:My First C++ Thread
// mm.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "mm.h" #ifdef _DEBUG#define new DEBUG_NEW#endif DWORD WINAPI ThreadProc(LPVOID lpParam){ int i =
2010-03-12 11:20:00 850
原创 画时钟:An Interesting Clock
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Drawing.Drawing2D;using System.Linq;using System.Text;using System.Windows
2010-03-12 11:15:00 352
原创 堆栈异常:Exception Class Is Not Empty
// stack is sequential list can be inserted or deleted at the top//seqstack is a stack using array#include "stdafx.h"#includeusing namespace std;class pushonfull {private: int value;public: pushonfu
2010-03-11 16:45:00 389
原创 重载输入输出流:Overload Ostream And Istream
#include "stdafx.h"#includeusing namespace std;templateclass complex{ template friend ostream& operator& z); template friend istream& operator>>(istream& ist,complex& z);private: T img; T real;publi
2010-03-11 15:52:00 521
原创 数据库点滴:Some useful ideas of database
1 The members having the same favourate category Query the members having the same favourate category:select category.category,md1.fistname,md1.lastname,md2.firstname,md2.lastnamefrom favcateg
2010-03-11 15:35:00 347
A Simple Chatting Program using C++
2009-10-21
Make Two Timers using MFC
2009-09-13
WF Practice
2009-05-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人