Saturday, December 26, 2009

System.Interactive

Bart de Smet's has published an article describing Reactive Extensions for .Net (including IObserver and IObservable)

Distinction diagram between interactive programming and reactive programming.


See also Somasegar sample using IObserver and IObservable interfaces.

Sharp Tests Ex

Hi all,

searching extensions methods projects in CodePlex, i found Sharp Tests Ex, is a set of extensible extensions to reduce code in assertions.

Sharp Tests Ex supports : NUnit, MsTests, xUnit, and MbUnit.

Sample from Codeplex :
true.Should().Be.True();
false.Should().Be.False();

const string somethig = "something";
somethig.Should().Contain("some");
somethig.Should().Not.Contain("also");
somethig.ToUpperInvariant().Should().Not.Contain("some");

somethig.Should()
.StartWith("so")
.And
.EndWith("ing")
.And
.Contain("meth");

somethig.Should()
.Not.StartWith("ing")
.And
.Not.EndWith("so")
.And
.Not.Contain("body");

var ints = new[] { 1, 2, 3 };
ints.Should().Have.SameSequenceAs(new[] { 1, 2, 3 });
ints.Should().Not.Have.SameSequenceAs(new[] { 3, 2, 1 });
ints.Should().Not.Be.Null();
ints.Should().Not.Be.Empty();

ints.Should()
.Contain(2)
.And
.Not.Contain(4);

(new int[0]).Should().Be.Empty();

See also MSTestExtensions

Joel on Test

Test published by Joel Spolsky to mesure a good software team, with 12 easy questions.

1. Do you use source control?
2. Can you make a build in one step?
3. Do you make daily builds?
4. Do you have a bug database?
5. Do you fix bugs before writing new code?
6. Do you have an up-to-date schedule?
7. Do you have a spec?
8. Do programmers have quiet working conditions?
9. Do you use the best tools money can buy?
10. Do you have testers?
11. Do new candidates write code during their interview?
12. Do you do hallway usability testing?

Extension Method.NET

ExtensionMethod.NET is a extension methods repository.



See also Extension Methods projects in CodePlex

Thursday, December 24, 2009

Ruby symbols in C#

Qwertie has published a c# version of symbol ruby language feature in CodeProject.

This a alternative to use enumerations or static classes with constants.
public static class ShapeType
{
public static readonly SymbolPool Pool = new SymbolPool();
public static readonly Symbol Circle = Pool.Get("Circle");
public static readonly Symbol Rect = Pool.Get("Rect");
public static readonly Symbol Line = Pool.Get("Line");
public static readonly Symbol Polygon = Pool.Get("Polygon");
}

public static class FractalShape
{
public static readonly SymbolPool Pool = ShapeType.Pool;
public static readonly Symbol Mandelbrot = Pool.Get("XyzCorp.Mandelbrot");
public static readonly Symbol Julia = Pool.Get("XyzCorp.Julia");
public static readonly Symbol Fern = Pool.Get("XyzCorp.Fern");
}

public void DrawShape(Symbol shapeType, PointF[] coordinates)
{
if (shapeType.Pool != ShapeType.Pool)
throw new ArgumentException("Invalid shape type", "shapeType");
...
...
}

JavaScript Looping Techniques

Elijah T. Manor has published an article describing performance looping arrays in Javascript.

Monday, December 21, 2009

ASP.NET Paths

Rick Strahl has published an article describing ASP.NET Paths using "Request" (Physical Path, Logical Path, Virtual Path properties) and "Server" objects.

HTML 5 Cheat Sheet

Antonio Lupetti has published an HTML Cheat Sheet.



Download in PDF Format

Sunday, December 20, 2009

Observer Pattern (a quick tour)

Anides has published on CodeProject a quick tour to Observer Pattern.

Saturday, December 19, 2009

CommandBarButton FaceId



Nigel Rheam has published an article describing a reference list (faceid and icon)

CommandBarButton is used in VSTO to create buttons in Office toolbars.

NH and Query Object

Richard Brown has published an article describing Query Object, a feature in future NH 3.0, to support Extension methods and Lambdas expressions in ICriteria API.

.Add(Expression.Eq("Name", "Smith"))
becomes
.Where<Person>(p => p.Name == "Smith")

Microsoft Application Architecture Guide


Patterns and Practices has published Microsoft Application Architecture Guide, 2nd Edition

Wednesday, December 16, 2009

IronPython released

IronPython has published last stable version.

IronPython is an implementation of the Python programming language running under .NET and Silverlight.

HelloWorld sample :)

import clr
clr.AddReference('System.Windows.Forms')

from System.Windows.Forms import Application, Form, Label

form = Form(Text="Hello World Form")
label = Label(Text="Hello World!")

form.Controls.Add(label)

Application.Run(form)

Sunday, December 13, 2009

Understanding Performance

Howard Dierking has published two articles (Part 1 and Part 2) describing some aspects of performance perceived by user and the truth.

ASP.NET Cache Limits

UK ADC has published an article describing ASP.NET Cache and settings limits.

ASP.NET Cache is very similar to Cache Application Block from Enterprise Library.

Friday, December 11, 2009

DataPager and URL Routing

Michal Altair Valasek has published an article in code project, to combine URL Routing + Data Pager control.

Unity and ASP.NET MVC

Simone Chiaretta has published an article to use Unity (a IOC Framework) on ASP.NET MVC to create controllers.

Steps
  1. Implement a class inherits from DefaultControllerFactory class or implement IControllerFactory interface.
  2. Register class in ControllerBuilder, using SetControllerFactory method.

See also IOC Martin Fowler article

Thursday, December 10, 2009

External file as ITemplate

David Fowler has published an article to use a external ascx file (Web UserControl) as ITemplate.

Sample use
<asp:Repeater ID="repeater" runat="server" ItemTemplate="~/MyUserControl.ascx">
</asp:Repeater>

Download sample code

Speed Tracer

Google has published Speed Tracer.



Speed Tracer is a chrome extension to test and analyze websites performance.



See also Tutorial video

Wednesday, December 9, 2009

EntLib 5.0 preview video

Grigori Melnik has publisehd video presenting Enterprise Library 5.0 preview in P&P Summit 2009.


Enterprise Library v5 preview at the p&p Summit 2009

Monday, December 7, 2009

ScottGu Presentations

Scott Guthrie has published an article containing links to Slides and Demos on VS 2010.

ASP.NET 4.0 :

ASP.NET MVC 2.0 :

SILVERLIGHT 4 :

D3 working on VS 2010 Beta 2

ADO Entity Framework Team has released D3, a Entity Framework sample application.

Saturday, December 5, 2009

NHibernate in MSDN

MSDN has published Magazine December 2009 with an article describing how to build a desktop application using NHibernate.

Silverlight 4 and PDC09

Tim Heuer has published an article with Silverlight videos from PDC09.

Multiple outputs

Damien Guard has write a post describing how to generate multiple outputs using T4 Templates using a helper class.

See also T4 post by Scott Hanselman

Silverlight 4 Videos

Microsoft has published videos to learn more about Silverlight 4 new features.

See also Silverlight 4 Beta Hands On Labs

Simplify ASP.Net

Craig Shoemaker has published an article to simplify ASP.Net development.

  • Overload the DataBind Method
  • Implement IsFirstRequest Property
  • Implement Application Name
  • Option to Categorize IntelliSense Members
  • Bring XAML Data Binding Syntax to ASP.NET
  • Parameter Attributes
  • WebForms Model Binders
  • JavaScript Model Binders
  • Select the Location of ViewState
  • Disabling the Post Back Button
  • Implement ASP.NET Configuration Console as Portable Area
  • Script-Based Post Backs


See also Scott Hunter Podcast

Visual NHibernate

Slyce Software has published Visual NHibernate (Beta)

Features :
  • Support new and existing projects.
  • Mapping Designer
  • Inheritance Designer
  • Multiple Databases



See also Screenshots

Tuesday, December 1, 2009

Slide Navigation Bar with jQuery + CSS

Mary Lou has published an article describing how to implement a Slide Navigation Bar using jQuery and CSS.



See also beautiful Demo :)

Monday, November 30, 2009

Silverlight 4 + MEF

Glenn Block has published an article describing MEF (Managed Extensibility Framework) in Silverlight 4.

MEF simplifies the creation of extensible applications and offers discovery and composition capabilities.



See also PDC Session : Building Extensible Rich Internet Applications with the Managed Extensibility Framework from PDC09 with Glenn Block.
And see also Glenn article to build a MEF Silverlight Appp from scratch.