Wednesday, August 8, 2012

IIS 6.0 Management Compataility

My colleague ran into this issue when trying to open a WCF service in Visual Studio 2010 in Windows 7.
I encountered this before and I remembered installing the IIS 6.0 Management Compatability solves the problem.

So try my usual way of Googl-ing and found this steps.

Install the IIS 6.0 Management Compatibility Components in Windows 7 or in Windows Vista from Control Panel
  1. Click Start, click Control Panel, click Programs and Features, and then click Turn Windows features on or off.
  2. Open Internet Information Services.
  3. Open Web Management Tools.
  4. Open IIS 6.0 Management Compatibility.
  5. Click to select the IIS 6 Metabase and IIS 6 configuration compatibility, IIS 6 WMI Compatibility, and IIS 6 Management Console check boxes.
  6. Click OK.

Sunday, August 5, 2012

Custom Date and Time Format Strings

http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx

Format specifierDescriptionExamples
"d"The day of the month, from 1 through 31.
More information: The "d" Custom Format Specifier.
6/1/2009 1:45:30 PM -> 1
6/15/2009 1:45:30 PM -> 15
"dd"The day of the month, from 01 through 31.
More information: The "dd" Custom Format Specifier.
6/1/2009 1:45:30 PM -> 01
6/15/2009 1:45:30 PM -> 15
"ddd"The abbreviated name of the day of the week.
More information: The "ddd" Custom Format Specifier.
6/15/2009 1:45:30 PM -> Mon (en-US)
6/15/2009 1:45:30 PM -> Пн (ru-RU)
6/15/2009 1:45:30 PM -> lun. (fr-FR)
"dddd"The full name of the day of the week.
More information: The "dddd" Custom Format Specifier.
6/15/2009 1:45:30 PM -> Monday (en-US)
6/15/2009 1:45:30 PM -> понедельник (ru-RU)
6/15/2009 1:45:30 PM -> lundi (fr-FR)
"f"The tenths of a second in a date and time value.
More information: The "f" Custom Format Specifier.
6/15/2009 13:45:30.617 -> 6
6/15/2009 13:45:30.050 -> 0
"ff"The hundredths of a second in a date and time value.
More information: The "ff" Custom Format Specifier.
6/15/2009 13:45:30.617 -> 61
6/15/2009 13:45:30.005 -> 00
"fff"The milliseconds in a date and time value.
More information: The "fff" Custom Format Specifier.
6/15/2009 13:45:30.617 -> 617
6/15/2009 13:45:30.0005 -> 000
"ffff"The ten thousandths of a second in a date and time value.
More information: The "ffff" Custom Format Specifier.
6/15/2009 13:45:30.6175 -> 6175
6/15/2009 13:45:30.00005 -> 0000
"fffff"The hundred thousandths of a second in a date and time value.
More information: The "fffff" Custom Format Specifier.
6/15/2009 13:45:30.61754 -> 61754
6/15/2009 13:45:30.000005 -> 00000
"ffffff"The millionths of a second in a date and time value.
More information: The "ffffff" Custom Format Specifier.
6/15/2009 13:45:30.617542 -> 617542
6/15/2009 13:45:30.0000005 -> 000000
"fffffff"The ten millionths of a second in a date and time value.
More information: The "fffffff" Custom Format Specifier.
6/15/2009 13:45:30.6175425 -> 6175425
6/15/2009 13:45:30.0001150 -> 0001150
"F"If non-zero, the tenths of a second in a date and time value.
More information: The "F" Custom Format Specifier.
6/15/2009 13:45:30.617 -> 6
6/15/2009 13:45:30.050 -> (no output)
"FF"If non-zero, the hundredths of a second in a date and time value.
More information: The "FF" Custom Format Specifier.
6/15/2009 13:45:30.617 -> 61
6/15/2009 13:45:30.005 -> (no output)
"FFF"If non-zero, the milliseconds in a date and time value.
More information: The "FFF" Custom Format Specifier.
6/15/2009 13:45:30.617 -> 617
6/15/2009 13:45:30.0005 -> (no output)
"FFFF"If non-zero, the ten thousandths of a second in a date and time value.
More information: The "FFFF" Custom Format Specifier.
6/1/2009 13:45:30.5275 -> 5275
6/15/2009 13:45:30.00005 -> (no output)
"FFFFF"If non-zero, the hundred thousandths of a second in a date and time value.
More information: The "FFFFF" Custom Format Specifier.
6/15/2009 13:45:30.61754 -> 61754
6/15/2009 13:45:30.000005 -> (no output)
"FFFFFF"If non-zero, the millionths of a second in a date and time value.
More information: The "FFFFFF" Custom Format Specifier.
6/15/2009 13:45:30.617542 -> 617542
6/15/2009 13:45:30.0000005 -> (no output)
"FFFFFFF"If non-zero, the ten millionths of a second in a date and time value.
More information: The "FFFFFFF" Custom Format Specifier.
6/15/2009 13:45:30.6175425 -> 6175425
6/15/2009 13:45:30.0001150 -> 000115
"g", "gg"The period or era.
More information: The "g" or "gg" Custom Format Specifier.
6/15/2009 1:45:30 PM -> A.D.
"h"The hour, using a 12-hour clock from 1 to 12.
More information: The "h" Custom Format Specifier.
6/15/2009 1:45:30 AM -> 1
6/15/2009 1:45:30 PM -> 1
"hh"The hour, using a 12-hour clock from 01 to 12.
More information: The "hh" Custom Format Specifier.
6/15/2009 1:45:30 AM -> 01
6/15/2009 1:45:30 PM -> 01
"H"The hour, using a 24-hour clock from 0 to 23.
More information: The "H" Custom Format Specifier.
6/15/2009 1:45:30 AM -> 1
6/15/2009 1:45:30 PM -> 13
"HH"The hour, using a 24-hour clock from 00 to 23.
More information: The "HH" Custom Format Specifier.
6/15/2009 1:45:30 AM -> 01
6/15/2009 1:45:30 PM -> 13
"K"Time zone information.
More information: The "K" Custom Format Specifier.
With DateTime values:
6/15/2009 1:45:30 PM, Kind Unspecified ->
6/15/2009 1:45:30 PM, Kind Utc -> Z
6/15/2009 1:45:30 PM, Kind Local -> -07:00 (depends on local computer settings)
With DateTimeOffset values:
6/15/2009 1:45:30 AM -07:00 --> -07:00
6/15/2009 8:45:30 AM +00:00 --> +00:00
"m"The minute, from 0 through 59.
More information: The "m" Custom Format Specifier.
6/15/2009 1:09:30 AM -> 9
6/15/2009 1:09:30 PM -> 9
"mm"The minute, from 00 through 59.
More information: The "mm" Custom Format Specifier.
6/15/2009 1:09:30 AM -> 09
6/15/2009 1:09:30 PM -> 09
"M"The month, from 1 through 12.
More information: The "M" Custom Format Specifier.
6/15/2009 1:45:30 PM -> 6
"MM"The month, from 01 through 12.
More information: The "MM" Custom Format Specifier.
6/15/2009 1:45:30 PM -> 06
"MMM"The abbreviated name of the month.
More information: The "MMM" Custom Format Specifier.
6/15/2009 1:45:30 PM -> Jun (en-US)
6/15/2009 1:45:30 PM -> juin (fr-FR)
6/15/2009 1:45:30 PM -> Jun (zu-ZA)
"MMMM"The full name of the month.
More information: The "MMMM" Custom Format Specifier.
6/15/2009 1:45:30 PM -> June (en-US)
6/15/2009 1:45:30 PM -> juni (da-DK)
6/15/2009 1:45:30 PM -> uJuni (zu-ZA)
"s"The second, from 0 through 59.
More information: The "s" Custom Format Specifier.
6/15/2009 1:45:09 PM -> 9
"ss"The second, from 00 through 59.
More information: The "ss" Custom Format Specifier.
6/15/2009 1:45:09 PM -> 09
"t"The first character of the AM/PM designator.
More information: The "t" Custom Format Specifier.
6/15/2009 1:45:30 PM -> P (en-US)
6/15/2009 1:45:30 PM -> 午 (ja-JP)
6/15/2009 1:45:30 PM -> (fr-FR)
"tt"The AM/PM designator.
More information: The "tt" Custom Format Specifier.
6/15/2009 1:45:30 PM -> PM (en-US)
6/15/2009 1:45:30 PM -> 午後 (ja-JP)
6/15/2009 1:45:30 PM -> (fr-FR)
"y"The year, from 0 to 99.
More information: The "y" Custom Format Specifier.
1/1/0001 12:00:00 AM -> 1
1/1/0900 12:00:00 AM -> 0
1/1/1900 12:00:00 AM -> 0
6/15/2009 1:45:30 PM -> 9
"yy"The year, from 00 to 99.
More information: The "yy" Custom Format Specifier.
1/1/0001 12:00:00 AM -> 01
1/1/0900 12:00:00 AM -> 00
1/1/1900 12:00:00 AM -> 00
6/15/2009 1:45:30 PM -> 09
"yyy"The year, with a minimum of three digits.
More information: The "yyy" Custom Format Specifier.
1/1/0001 12:00:00 AM -> 001
1/1/0900 12:00:00 AM -> 900
1/1/1900 12:00:00 AM -> 1900
6/15/2009 1:45:30 PM -> 2009
"yyyy"The year as a four-digit number.
More information: The "yyyy" Custom Format Specifier.
1/1/0001 12:00:00 AM -> 0001
1/1/0900 12:00:00 AM -> 0900
1/1/1900 12:00:00 AM -> 1900
6/15/2009 1:45:30 PM -> 2009
"yyyyy"The year as a five-digit number.
More information: The "yyyyy" Custom Format Specifier.
1/1/0001 12:00:00 AM -> 00001
6/15/2009 1:45:30 PM -> 02009
"z"Hours offset from UTC, with no leading zeros.
More information: The "z" Custom Format Specifier.
6/15/2009 1:45:30 PM -07:00 -> -7
"zz"Hours offset from UTC, with a leading zero for a single-digit value.
More information: The "zz" Custom Format Specifier.
6/15/2009 1:45:30 PM -07:00 -> -07
"zzz"Hours and minutes offset from UTC.
More information: The "zzz" Custom Format Specifier.
6/15/2009 1:45:30 PM -07:00 -> -07:00
":"The time separator.
More information: The ":" Custom Format Specifier.
6/15/2009 1:45:30 PM -> : (en-US)
6/15/2009 1:45:30 PM -> . (it-IT)
6/15/2009 1:45:30 PM -> : (ja-JP)
"/"The date separator.
More Information: The "/" Custom Format Specifier.
6/15/2009 1:45:30 PM -> / (en-US)
6/15/2009 1:45:30 PM -> - (ar-DZ)
6/15/2009 1:45:30 PM -> . (tr-TR)
"string"
'string'
Literal string delimiter. 6/15/2009 1:45:30 PM ("arr:" h:m t) -> arr: 1:45 P
6/15/2009 1:45:30 PM ('arr:' h:m t) -> arr: 1:45 P
%Defines the following character as a custom format specifier.
More information: Using Single Custom Format Specifiers.
6/15/2009 1:45:30 PM (%h) -> 1
\The escape character.6/15/2009 1:45:30 PM (h \h) -> 1 h
Any other characterThe character is copied to the result string unchanged.
More information: Using the Escape Character.
6/15/2009 1:45:30 AM (arr hh:mm t) -> arr 01:45 A

Free Microsoft E-Books

Wow, received this email about free e-books collection available for download.
http://blogs.msdn.com/b/mssmallbiz/archive/2012/07/27/large-collection-of-free-microsoft-ebooks-for-you-including-sharepoint-visual-studio-windows-phone-windows-8-office-365-office-2010-sql-server-2012-azure-and-more.aspx

Microsoft is giving away a TON of free technical eBooks.  These aren’t old technologies like Window 3.11 either.  There are books on:
·         Windows Server 2012
·         Virtualization
·         SQL 2012
·         SQL 2008 R2
·         SharePoint
·         Visual Studio 2010
·         ASP.NET
·         Windows Azure
·         Office 2010
·         Windows 7
·         And all kinds of technical guides.

Tuesday, July 31, 2012

CultureInfo Class

For the list of CultureInfo country, below are the list:

http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo(v=vs.71).aspx


Culture NameCulture IdentifierLanguage-Country/Region
"" (empty string)0x007Finvariant culture
af0x0036Afrikaans
af-ZA0x0436Afrikaans - South Africa
sq0x001CAlbanian
sq-AL0x041CAlbanian - Albania
ar0x0001Arabic
ar-DZ0x1401Arabic - Algeria
ar-BH0x3C01Arabic - Bahrain
ar-EG0x0C01Arabic - Egypt
ar-IQ0x0801Arabic - Iraq
ar-JO0x2C01Arabic - Jordan
ar-KW0x3401Arabic - Kuwait
ar-LB0x3001Arabic - Lebanon
ar-LY0x1001Arabic - Libya
ar-MA0x1801Arabic - Morocco
ar-OM0x2001Arabic - Oman
ar-QA0x4001Arabic - Qatar
ar-SA0x0401Arabic - Saudi Arabia
ar-SY0x2801Arabic - Syria
ar-TN0x1C01Arabic - Tunisia
ar-AE0x3801Arabic - United Arab Emirates
ar-YE0x2401Arabic - Yemen
hy0x002BArmenian
hy-AM0x042BArmenian - Armenia
az0x002CAzeri
az-AZ-Cyrl0x082CAzeri (Cyrillic) - Azerbaijan
az-AZ-Latn0x042CAzeri (Latin) - Azerbaijan
eu0x002DBasque
eu-ES0x042DBasque - Basque
be0x0023Belarusian
be-BY0x0423Belarusian - Belarus
bg0x0002Bulgarian
bg-BG0x0402Bulgarian - Bulgaria
ca0x0003Catalan
ca-ES0x0403Catalan - Catalan
zh-HK0x0C04Chinese - Hong Kong SAR
zh-MO0x1404Chinese - Macau SAR
zh-CN0x0804Chinese - China
zh-CHS0x0004Chinese (Simplified)
zh-SG0x1004Chinese - Singapore
zh-TW0x0404Chinese - Taiwan
zh-CHT0x7C04Chinese (Traditional)
hr0x001ACroatian
hr-HR0x041ACroatian - Croatia
cs0x0005Czech
cs-CZ0x0405Czech - Czech Republic
da0x0006Danish
da-DK0x0406Danish - Denmark
div0x0065Dhivehi
div-MV0x0465Dhivehi - Maldives
nl0x0013Dutch
nl-BE0x0813Dutch - Belgium
nl-NL0x0413Dutch - The Netherlands
en0x0009English
en-AU0x0C09English - Australia
en-BZ0x2809English - Belize
en-CA0x1009English - Canada
en-CB0x2409English - Caribbean
en-IE0x1809English - Ireland
en-JM0x2009English - Jamaica
en-NZ0x1409English - New Zealand
en-PH0x3409English - Philippines
en-ZA0x1C09English - South Africa
en-TT0x2C09English - Trinidad and Tobago
en-GB0x0809English - United Kingdom
en-US0x0409English - United States
en-ZW0x3009English - Zimbabwe
et0x0025Estonian
et-EE0x0425Estonian - Estonia
fo0x0038Faroese
fo-FO0x0438Faroese - Faroe Islands
fa0x0029Farsi
fa-IR0x0429Farsi - Iran
fi0x000BFinnish
fi-FI0x040BFinnish - Finland
fr0x000CFrench
fr-BE0x080CFrench - Belgium
fr-CA0x0C0CFrench - Canada
fr-FR0x040CFrench - France
fr-LU0x140CFrench - Luxembourg
fr-MC0x180CFrench - Monaco
fr-CH0x100CFrench - Switzerland
gl0x0056Galician
gl-ES0x0456Galician - Galician
ka0x0037Georgian
ka-GE0x0437Georgian - Georgia
de0x0007German
de-AT0x0C07German - Austria
de-DE0x0407German - Germany
de-LI0x1407German - Liechtenstein
de-LU0x1007German - Luxembourg
de-CH0x0807German - Switzerland
el0x0008Greek
el-GR0x0408Greek - Greece
gu0x0047Gujarati
gu-IN0x0447Gujarati - India
he0x000DHebrew
he-IL0x040DHebrew - Israel
hi0x0039Hindi
hi-IN0x0439Hindi - India
hu0x000EHungarian
hu-HU0x040EHungarian - Hungary
is0x000FIcelandic
is-IS0x040FIcelandic - Iceland
id0x0021Indonesian
id-ID0x0421Indonesian - Indonesia
it0x0010Italian
it-IT0x0410Italian - Italy
it-CH0x0810Italian - Switzerland
ja0x0011Japanese
ja-JP0x0411Japanese - Japan
kn0x004BKannada
kn-IN0x044BKannada - India
kk0x003FKazakh
kk-KZ0x043FKazakh - Kazakhstan
kok0x0057Konkani
kok-IN0x0457Konkani - India
ko0x0012Korean
ko-KR0x0412Korean - Korea
ky0x0040Kyrgyz
ky-KZ0x0440Kyrgyz - Kazakhstan
lv0x0026Latvian
lv-LV0x0426Latvian - Latvia
lt0x0027Lithuanian
lt-LT0x0427Lithuanian - Lithuania
mk0x002FMacedonian
mk-MK0x042FMacedonian - FYROM
ms0x003EMalay
ms-BN0x083EMalay - Brunei
ms-MY0x043EMalay - Malaysia
mr0x004EMarathi
mr-IN0x044EMarathi - India
mn0x0050Mongolian
mn-MN0x0450Mongolian - Mongolia
no0x0014Norwegian
nb-NO0x0414Norwegian (Bokml) - Norway
nn-NO0x0814Norwegian (Nynorsk) - Norway
pl0x0015Polish
pl-PL0x0415Polish - Poland
pt0x0016Portuguese
pt-BR0x0416Portuguese - Brazil
pt-PT0x0816Portuguese - Portugal
pa0x0046Punjabi
pa-IN0x0446Punjabi - India
ro0x0018Romanian
ro-RO0x0418Romanian - Romania
ru0x0019Russian
ru-RU0x0419Russian - Russia
sa0x004FSanskrit
sa-IN0x044FSanskrit - India
sr-SP-Cyrl0x0C1ASerbian (Cyrillic) - Serbia
sr-SP-Latn0x081ASerbian (Latin) - Serbia
sk0x001BSlovak
sk-SK0x041BSlovak - Slovakia
sl0x0024Slovenian
sl-SI0x0424Slovenian - Slovenia
es0x000ASpanish
es-AR0x2C0ASpanish - Argentina
es-BO0x400ASpanish - Bolivia
es-CL0x340ASpanish - Chile
es-CO0x240ASpanish - Colombia
es-CR0x140ASpanish - Costa Rica
es-DO0x1C0ASpanish - Dominican Republic
es-EC0x300ASpanish - Ecuador
es-SV0x440ASpanish - El Salvador
es-GT0x100ASpanish - Guatemala
es-HN0x480ASpanish - Honduras
es-MX0x080ASpanish - Mexico
es-NI0x4C0ASpanish - Nicaragua
es-PA0x180ASpanish - Panama
es-PY0x3C0ASpanish - Paraguay
es-PE0x280ASpanish - Peru
es-PR0x500ASpanish - Puerto Rico
es-ES0x0C0ASpanish - Spain
es-UY0x380ASpanish - Uruguay
es-VE0x200ASpanish - Venezuela
sw0x0041Swahili
sw-KE0x0441Swahili - Kenya
sv0x001DSwedish
sv-FI0x081DSwedish - Finland
sv-SE0x041DSwedish - Sweden
syr0x005ASyriac
syr-SY0x045ASyriac - Syria
ta0x0049Tamil
ta-IN0x0449Tamil - India
tt0x0044Tatar
tt-RU0x0444Tatar - Russia
te0x004ATelugu
te-IN0x044ATelugu - India
th0x001EThai
th-TH0x041EThai - Thailand
tr0x001FTurkish
tr-TR0x041FTurkish - Turkey
uk0x0022Ukrainian
uk-UA0x0422Ukrainian - Ukraine
ur0x0020Urdu
ur-PK0x0420Urdu - Pakistan
uz0x0043Uzbek
uz-UZ-Cyrl0x0843Uzbek (Cyrillic) - Uzbekistan
uz-UZ-Latn0x0443Uzbek (Latin) - Uzbekistan
vi0x002AVietnamese
vi-VN0x042AVietnamese - Vietnam

Tuesday, May 29, 2012

Design Pattern - Strategy

http://en.wikipedia.org/wiki/Strategy_pattern
 
Intent:
  1. Define a family of algorithms, encapsulate each one, and make them interchangeable.
  2. Strategy lets the algorithm vary independently from clients that use it.
  3. Policy
Applicability:

  1. Classes differ only in their behavior.
  2. Different variants of an algorithm.
  3. Algorithm uses data that clients shouldn't know about.
  4. A class defines many behaviors. 
Structure:

 
Participants:

Strategy 
  1. declares an interface common to all supported algorithms. 
  2. Context uses this interface to call the algorithm defined by a ConcreteStrategy.
ConcreteStrategy
  1. implements the algorithm using the Strategy interface.
Context
  1. is configured with a ConcreteStrategy object.
  2. maintains a reference to a Strategy object.
  3. may define an interface that lets Strategy access its data. 
Overview:

  1. Strategy and Context interact to implement the chosen algorithm.
  2. A context may pass all data required by the algorithm to the strategy when the algorithm is called.
  3. Alternatively, the context can pass itself as an argument to Strategy operations. That lets the strategy call back on the context as required.
  4. A context forwards request from its clients to its strategy.
  5. Client usually create and pass a ConcreteStrategy object to the context; thereafter, clients interact with the context exclusively.
  6. There is often a family of ConcreteStrategy classes for a client to choose from.
  7. Families of related algorithms.
  8. An alternative to subclassing.
  9. Strategies eliminate conditional statements.
  10. A choice of implementations.
  11. Clients must be aware of different Strategies.
  12. Communication overhead between Strategy and Context.
  13. Increased number of objects.
Applications:
  1. Compositor
  2. SimpleCompositor, TeXCompositor, ArrayCompositor
  3. Composition

 

Design Pattern - Observer

http://en.wikipedia.org/wiki/Observer_pattern
Intent:
  1. Define one-to-many dependency between objects so that when one objects changes state, all its dependents are notified and updated Automatically
  2. Dependents, Publish-Subscribe, Model-View
Applicability:
  1. When an abstraction has two aspects, one dependent on the other.
  2. When a change to one object requires changing others without being coupled.
Structure:

Participants:
Subject
  1. knows its observers.
  2. any number of Observer objects may observe a subject.
  3. provides an interface for attaching and detaching Observer objects.
Observer
  1. defines an updating interface for objects that should be notified of changes in a subject.
ConcreteSubject
  1. stores state of interest to ConcreteObserver objects.
  2. sends a notification to its observers when its state changes.
ConcreteObserver
  1. maintains a reference to a ConcreteSubject object.
  2. stores state that should stay consistent with the subject's.
  3. implementes the Observer updating interface to keep its state consistent with the subject's.
Overview:
  1. ConcreteSubject notifies its observers whenever a change occurs that could make its observers' state inconsistent with its own.
  2. After being informed of a change in the concrete subject, a ConcreteObserver object may query the subject for information.
  3. ConcreteObserver uses this information to reconcile its state with that of the subject.
  4. Abstract coupling between Subject and Observer.
  5. Support for broadcast communication.
  6. Unexpected updates.
Applications:
Document - View architecture
  1. Document is responsible for data
  2. View is responsible for representing data
  3. There can be multiple type of document and view
  4. Any view can be interested in tracking changes in any document

Design Pattern - Template Method

http://en.wikipedia.org/wiki/Template_method_pattern

Intent:
  1. Define the skeleton of an algorithm in an operation, deferring some steps to subclasses and let subclasses redefine steps of an algorithm without changing the algorithm's structure.
Applicability:
  1. To implement the invariant parts of an algorithm once and leave it up to subclasses to implement the behaviro that can vary.
  2. Avoid code duplication.
  3. To control subclasses exensions.
Structure:

Participants:
AbstractClass
  1. defines abstract primitive operations that concrete subclasses define to implement steps of an algorithm.
  2. implements a template method defining the skeleton of an algorithm.
  3. The template method calls primitive operations as well as operations defined in AbstractClass or those of other objects.
ConcreteClass
  1. implements the primitive opreations to carry out subclass-specific steps of the algorithm.
Overview:
ConcreteClass relies on AbstractClass to implement the invariant steps of the algorithm
  1. Reuses code
  2. Factors common behavior.
  3. Realizes "HR" principle.
Applications:
  1. Application
  2. MyApplication
  3. Print Document
  4. Manufacture
  5. Approve loan:
    1. bank history
    2. credit score from credit card companies
    3. other loan history
    4. evaluate assets
    5. income in the future
  6. Make Pizza
    1. take order & money
    2. send order to kitchen
    3. receive pizza from kitchen
    4. deliver pizza
    5. clean table

Design Pattern - Singleton

http://en.wikipedia.org/wiki/Singleton_pattern

Intent:
  1. Ensure that a class has one and only one instance, and provide a global point of access to the instance
Applicability:
  1. Exactly N instance(s) of a class needed:
    1. must be accessible to clients
    2. a well-known access point
  2. When class of sole instance should be extensible
Structure:


Participants:
  1. Singleton defines an Instance operation that lets clients access its unique instance.
  2. Instance is a class operation (e.e. static member funciton in C++).
  3. May be responsible for creating its own unique instance.
Overview:
Client accss a Singleton instance solely through Singleton's instance operation
  1. Controlled access to sole instance.
  2. Reduced name space.
  3. Permoits refinement of operations and representation.
  4. Permits a variable number of instances.
  5. More flexible than class operations.
Applications:
  1. Settings
  2. Configuration Data
  3. Read-only Data / Cache
  4. Print spooler

Design Pattern

What is a design pattern?
Pattern describes a problem which occurs over and over again in a context, and then describes the core of the solution to that problem, in such a way that you can use this core of solution a million times over, without ever using it the same way twice.
  • Language-independent strategies for solving common object-oriented design problems
  • Common solution to common problem in context and system of forces
  • Solution to a narrowly-scoped common technical problem
  • Abstraction from a concretion recurring in specific, non-arbitrary contexts
  • Successfully recurring best practice that has proven itself in the trneches
  • A literary format for capturing wisdom and experience of expert designers, and communicating it to novices.
Why design pattern?
Designing object-oriented code is hard, and designing reusable object-oriented software is even harder - Why?
Patterns enable programmers to recognize a problem and immediately determine the solution without having to stop and analyze the problem first.
Provides a framework for communicating complexities of OO design at a high level of abstraction
Bottom line: Design Productivity
  • Solve "real world" problems
  • Capture domain expertise
  • Document design decisions and rationale
  • Reuse wisdowm and experience of practitioners
  • Convey expert insight
  • Shared vocabulary for problem-solving
  • Show more than just the solution
  • Teaches OO way!
Object Oriented Pillars
  1. Abstraction
    • Getting something out
    • A process of classifying objects
    • E.g. Men, women, car, window
    • A class of objects
  2. Encapsulation (and Polymorphism)
    • Getting something hidden
    • Something private that can be access through a public functionYou hide a private implementation inside a public interface
    • Poly: One interface, multiple implementation
    • Simplifies source code
  3. Modularity
    • Has the ability to disassemble & assemble back easily (without too much time)
    • Can work on module parallel
    • Each module less independent
  4. Hierarchy
    • Inheritance
    • Referential - one refer to one

Wednesday, March 7, 2012

WPF: Define Percentage In Column Widths

To define the percentage in the width, in the example below, instead of 70%, replace it with .7*.
<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width=".7*" />
        <ColumnDefinition Width=".3*" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <TextBlock Grid.Column="0">70% width</TextBlock>
    <TextBlock Grid.Column="1">30% width</TextBlock>
</Grid>

Monday, February 27, 2012

Microsoft Brushes.Colors

Collection of Colors Available with it's ARGB value in Microsoft.Net Framework 4.0.
http://msdn.microsoft.com/en-us/library/system.windows.media.colors.aspx

Special Characters Sort Order

Googled and found this. Useful for myself to understand on the sorting order for special characters.
 Here is a list of some of these characters along with the sort order (ascending to descending)

' (back tick)
- (hyphen)
! (exclamation)
# (pound symbol)
$ (dollar)
% (percent symbol)
& (ampersand)
( (open parenthesis)
) (close parenthesis)
* (asterisk)
@ (at symbol)
^ (carrot)
_ (underscore)
~ (tilde)
+ (plus)
= (equals)


Thanks to Jim McBee: http://msmvps.com/blogs/erikr/archive/2008/09/20/special-character-sort-order-gal.aspx