Saturday, February 27, 2010

Setting up Subversion

REFERENCES
http://www.codinghorror.com/blog/archives/001093.html
http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91&expandFolder=91&folderID=8100

INSTALLATION

1.1 Download latest svn and tortoise files from link above
1.2 Install Setup-Subversion-1.6.6.msi
1.3 Install TortoiseSVN-1.6.5.16974-x64-svn-1.6.5.msi (choose either x86 or x64 version)


REPOSITORY SETUP

2.1 Create folder for the repository on the server e.g D:\SVN\Repository

2.2 Navigate to D:\SVN\Repository, right click and select
'Create Repository here'

2.3 Choose FSFS filesystem

2.4 Create skeleton project structure somewhere: (where trunk is for
the main code, tags and branches for advanced stuff if used in the
future)

svn://localhost
+---PROJECT1
|   +---branches
|   +---tags
|   \---trunk
\---PROJECT2
   +---branches
   +---tags
   \---trunk

2.5 Right click folder Root, select 'Import' and navigate to
file:///D:/SVN/Repository


CREATE SVN SERVICE

3.1 Setup svnserve as Windows service using the following command (note space before auto after start=):
sc create svnserve binpath= "C:\Program Files (x86)\Subversion\bin\svnserve.exe --service --root D:\SVN\Repository" DisplayName= "Subversion Repository" depend= Tcpip start= auto
(logon as Local System)

3.2 Start the service and set to auto start

3.3 Add users and passwords to D:\SVN\Repository\conf\passwd file
   e.g. [users]
        username1 = password

3.4 Set authorisation settings by editing D:\SVN\Repository\conf\authz
   e.g. anon-access = none
        auth-access = write
        password-db = passwd


FIREWALL
Create rules names Subversion for port 3690, inbound & outbound, private network to allow access from other machines on the network.


GET IT WORKING ON A CLIENT MACHINE

4.1 On your machine, create a working code folder for a project, say
D:\CODE\PROJECT1

4.2 Checkout the trunk for that project by right clicking, selecting
'SVN Checkout', then navigating to
svn:///machinename/PROJECT1/trunk

Thats about it.



Sunday, February 21, 2010

MEF Links

Building Composable Apps in .NET 4 with the Managed Extensibility Framework
http://msdn.microsoft.com/en-us/magazine/ee291628.aspx

Codeplex docs
http://mef.codeplex.com/documentation

Digging a bit deeper
http://www.codeproject.com/KB/library/mefpart1.aspx
http://www.codeproject.com/KB/library/mefpart2.aspx

Web casts on everything you wanted to know about using MEF in Silverlight 4
http://codebetter.com/blogs/glenn.block/archive/2010/02/16/learning-about-mef-in-sl4-from-mike-taulty.aspx

People
http://blogs.msdn.com/gblock/default.aspx

MVC-MVP-MVVM Pattern article links

General Articles

DataModel-View-ViewModel pattern series by Dan Crevier
http://blogs.msdn.com/dancre/archive/2006/10/11/datamodel-view-viewmodel-pattern-series.aspx

Excellent overview including comparisons
http://www.aspiringcraftsman.com/2007/08/interactive-application-architecture/

 - Jeremy Miller's summary
http://codebetter.com/blogs/jeremy.miller/archive/2007/10/31/development-trivial-pursuit-the-difference-between-mvc-and-the-different-flavors-of-mvp.aspx
 -  Jeremy Miller's "Build Your Own CAB" series on designing WinForms apps

http://codebetter.com/blogs/jeremy.miller/archive/2007/07/25/the-build-your-own-cab-series-table-of-contents.aspx
http://code.google.com/p/buildyourowncab/source/browse/#svn/trunk/src

Stackoverflow discussion
http://stackoverflow.com/questions/2056/what-are-mvp-and-mvc-and-what-is-the-difference/101561#101561

Rob Eisenberg's MVVM study:
http://devlicio.us/blogs/rob_eisenberg/archive/2009/07/07/mvvm-philosophy-and-case-studies-introduction.aspx
http://devlicio.us/blogs/rob_eisenberg/archive/2009/08/02/mvvm-study-part-2-view-of-the-model-or-model-of-the-view.aspx
http://devlicio.us/blogs/rob_eisenberg/archive/2009/09/01/mvvm-study-part-3-why.aspx
http://devlicio.us/blogs/rob_eisenberg/archive/2009/11/13/mvvm-study-part-4-naked-wpf.aspx
http://devlicio.us/blogs/rob_eisenberg/archive/2009/12/14/mvvm-study-part-5-convention-over-configuration.aspx



WPF/Silverlight Frameworks

Prism: Composite Application Guidance for WPF and Silverlight
http://compositewpf.codeplex.com/
http://msdn.microsoft.com/en-us/library/cc707819.aspx (CAG docs)

Caliburn: MVC, MVP, MVVM and Commands for WPF and Silverlight applications
http://caliburn.codeplex.com/
http://caliburn.codeplex.com/documentation

Wednesday, February 17, 2010

String Formatting in C#

See these great references:

Numbers

Basic number formatting specifiers:

Specifier

Type

Format

Output (Passed Double 1.42)

Output (Passed Int -12400)

c

Currency

{0:c}

$1.42

-$12,400

d

Decimal (Whole number)

{0:d}

System.FormatException

-12400

e

Scientific

{0:e}

1.420000e+000

-1.240000e+004

f

Fixed point

{0:f}

1.42

-12400.00

g

General

{0:g}

1.42

-12400

n

Number with commas for thousands

{0:n}

1.42

-12,400

r

Round trippable

{0:r}

1.42

System.FormatException

x

Hexadecimal

{0:x4}

System.FormatException

cf90

Custom number formatting:

Specifier

Type

Example

Output (Passed Double 1500.42)

Note

0

Zero placeholder

{0:00.0000}

1500.4200

Pads with zeroes.

#

Digit placeholder

{0:(#).##}

(1500).42

.

Decimal point

{0:0.0}

1500.4

,

Thousand separator

{0:0,0}

1,500

Must be between two zeroes.

,.

Number scaling

{0:0,.}

2

Comma adjacent to Period scales by 1000.

%

Percent

{0:0%}

150042%

Multiplies by 100, adds % sign.

e

Exponent placeholder

{0:00e+0}

15e+2

Many exponent formats available.

;

Group separator

see below

Dates

Note that date formatting is especially dependant on the system’s regional settings.

Specifier

Type

Example (Passed System.DateTime.Now)

d

Short date

10/12/2002

D

Long date

December 10, 2002

t

Short time

10:11 PM

T

Long time

10:11:29 PM

f

Full date & time

December 10, 2002 10:11 PM

F

Full date & time (long)

December 10, 2002 10:11:29 PM

g

Default date & time

10/12/2002 10:11 PM

G

Default date & time (long)

10/12/2002 10:11:29 PM

M

Month day pattern

December 10

r

RFC1123 date string

Tue, 10 Dec 2002 22:11:29 GMT

s

Sortable date string

2002-12-10T22:11:29

u

Universal sortable, local time

2002-12-10 22:13:50Z

U

Universal sortable, GMT

December 11, 2002 3:13:50 AM

Y

Year month pattern

December, 2002

The ‘U’ specifier seems broken; that string certainly isn’t sortable.

Custom date formatting:

Specifier

Type

Example

Example Output

dd

Day

{0:dd}

10

ddd

Day name

{0:ddd}

Tue

dddd

Full day name

{0:dddd}

Tuesday

f, ff, …

Second fractions

{0:fff}

932

gg, …

Era

{0:gg}

A.D.

hh

2 digit hour

{0:hh}

10

HH

2 digit hour, 24hr format

{0:HH}

22

mm

Minute 00-59

{0:mm}

38

MM

Month 01-12

{0:MM}

12

MMM

Month abbreviation

{0:MMM}

Dec

MMMM

Full month name

{0:MMMM}

December

ss

Seconds 00-59

{0:ss}

46

tt

AM or PM

{0:tt}

PM

yy

Year, 2 digits

{0:yy}

02

yyyy

Year

{0:yyyy}

2002

zz

Timezone offset, 2 digits

{0:zz}

-05

zzz

Full timezone offset

{0:zzz}

-05:00

:

Separator

{0:hh:mm:ss}

10:43:20

/

Separator

{0:dd/MM/yyyy}

10/12/2002