經(jīng)典著作《設(shè)計(jì)模式》中將策略模式定義為:定義一系列的算法,把它們一個個的封裝起來,并且使它們可以相互轉(zhuǎn)換。這個定義還是比較抽象,下面我將通過一個例子來具體的講解策略模式。感覺這樣更容易幫助新手理解模式,這也是《Head First Design Patterns》中講解模式的方法。先來描述一下用到的例子的背景資料:
標(biāo)簽: 定義 設(shè)計(jì)模式 策略 模式
上傳時間: 2015-05-29
上傳用戶:lizhizheng88
MFC Black Book Introduction: Are you an MFC programmer? Good. There are two types of MFC programmers. What kind are you? The first kind are the good programmers who write programs that conform to the way MFC wants you to do things. The second bunch are wild-eyed anarchists who insist on getting things done their way. Me, I’m in the second group. If you are in the same boat (or would like to be) this book is for you. This book won’t teach you MFC—not in the traditional sense. You should pick it up with a good understanding of basic MFC programming and a desire to do things differently. This isn’t a Scribble tutorial (although I will review some fundamentals in the first chapter). You will learn how to wring every drop from your MFC programs. You’ll discover how to use, abuse, and abandon the document/view architecture. If you’ve ever wanted custom archives, you’ll find that, too.
標(biāo)簽: MFC Introduction programmer programme
上傳時間: 2015-05-30
上傳用戶:youke111
The government of a small but important country has decided that the alphabet needs to be streamlined and reordered. Uppercase letters will be eliminated. They will issue a royal decree in the form of a String of B and A characters. The first character in the decree specifies whether a must come ( B )Before b in the new alphabet or ( A )After b . The second character determines the relative placement of b and c , etc. So, for example, "BAA" means that a must come Before b , b must come After c , and c must come After d . Any letters beyond these requirements are to be excluded, so if the decree specifies k comparisons then the new alphabet will contain the first k+1 lowercase letters of the current alphabet. Create a class Alphabet that contains the method choices that takes the decree as input and returns the number of possible new alphabets that conform to the decree. If more than 1,000,000,000 are possible, return -1. Definition
標(biāo)簽: government streamline important alphabet
上傳時間: 2015-06-09
上傳用戶:weixiao99
LL(1)文法,消除隱藏左遞歸,提取共因子,然后求First,Follow,Select集,以及預(yù)測分析表,最后進(jìn)行預(yù)測分析
標(biāo)簽: LL
上傳時間: 2014-12-19
上傳用戶:GHF
Single-layer neural networks can be trained using various learning algorithms. The best-known algorithms are the Adaline, Perceptron and Backpropagation algorithms for supervised learning. The first two are specific to single-layer neural networks while the third can be generalized to multi-layer perceptrons.
標(biāo)簽: Single-layer algorithms best-known networks
上傳時間: 2015-06-17
上傳用戶:趙云興
學(xué)生注冊— 本模塊允許新的學(xué)生創(chuàng)建和維護(hù)他們的帳戶信息,帳戶信息包括:first name, last name, address, e-mail, login name, and password 學(xué)生驗(yàn)證— 本模塊處理學(xué)生的登錄過程,像驗(yàn)證用戶名和口令,這可以確保僅有已注冊的學(xué)習(xí)可以瀏覽課程目錄和注冊課程。 課程目錄瀏覽— 本模塊由Web site顯示學(xué)校當(dāng)前提供的課程和他們的 細(xì)節(jié),課程細(xì)節(jié)包括課程名和費(fèi)用 注冊購物車— 本模塊允許學(xué)生在瀏覽課程目錄中將選擇的課程放置入購物車,同時在下訂單前查看購物車的內(nèi)容。 訂單處理— 本模塊允許學(xué)生下訂單,和在正式下單前執(zhí)行必要的驗(yàn)證 管理員界面— 本模塊允許管理員查看和同意注冊的訂單 通知— 本模塊由系統(tǒng)發(fā)送E-MAIL給已注冊課程的學(xué)生
標(biāo)簽: 模塊
上傳時間: 2015-06-18
上傳用戶:yuzsu
Title: STL Tutorial and Reference Guide: C++ Programming with the Standard Template Library (2nd Edition) Author: David R. Musser / Gillmer J. Derge / Atul Saini / Gilmer J. Derge Publisher: Addison-Wesley Page: 560 Edition: 2nd edition (March 27, 2001) Format: PDF Summary: The Standard Template Library was created as the first library of genetic algorithms and data structures, with four ideas in mind: generic programming, abstractness without loss of efficiency, the Von Neumann computation model, and value semantics. This guide provides a tutorial, a description of each element of the library, and sample applications. The expanded second edition includes new code examples and demonstrations of the use of STL in real-world C++ software development it reflects changes made to STL for the final ANSI/ISO C++ language standard.
標(biāo)簽: Programming Reference Standard Template
上傳時間: 2014-01-19
上傳用戶:netwolf
A program to demonstrate the optimization process of ant colony optimization for the traveling saleman problem (TSP). The cities are shown as red circles, the pheromone on the connections between them (fully connected graph) by gray lines. The darker the grey, the more pheromone is currently on the edge. During the optimization, the currently best found tour is drawn in red. To run the optimization, first create a random TSP, then create an ant colony, and finally run the optimization.
標(biāo)簽: optimization demonstrate the traveling
上傳時間: 2015-07-12
上傳用戶:偷心的海盜
A program to find frequent itemsets (also closed and maximal) with the eclat algorithm ,which carries out a depth first search on the subset lattice and determines the support of itemsets by intersecting transaction lists.
標(biāo)簽: algorithm frequent itemsets program
上傳時間: 2013-12-27
上傳用戶:ouyangtongze
平均因子分解法,適用于正定矩陣First, let s recall the definition of the Cholesky decomposition: Given a symmetric positive definite square matrix X, the Cholesky decomposition of X is the factorization X=U U, where U is the square root matrix of X, and satisfies: (1) U U = X (2) U is upper triangular (that is, it has all zeros below the diagonal). It seems that the assumption of positive definiteness is necessary. Actually, it is "positive definite" which guarantees the existence of such kind of decomposition.
標(biāo)簽: 分解
上傳時間: 2013-12-24
上傳用戶:啊颯颯大師的
蟲蟲下載站版權(quán)所有 京ICP備2021023401號-1