Vincent Leung .NET Tech Clips

The latest tech clips from the .NET community

CSS Tutorials – Introduction To CSS Basics

 

A collection of 21 FAQs/tutorials tips on CSS (Cascading Style Sheets) basic. Clear answers are provided with tutorial exercises on CSS syntax basics, contextual, class, and id selectors, CSS cascading order rules, grouping CSS definitions, browswer default CSS definitions Topics included in this collection are:

  1. What Is CSS (Cascading Style Sheets)?
  2. What Is the Basic Unit of CSS?
  3. How Many Ways to Attach CSS to HTML Documents?
  4. How To Include CSS Inside a HTML Tag?
  5. How To Include CSS Inside the HEAD Tag?
  6. How To Store CSS Definitions in External Files?
  7. How Many Ways to Select HTML Tag Instances?
  8. What Is a Class Selector?
  9. What Is a ID Selector?
  10. What Is a Contextual Selector?
  11. What Is a Group Selector?
  12. What Is a Mixed Selector?
  13. What Are the Pseudo Classes on <A> Tags?
  14. How To Group CSS Definitions Together?
  15. What Is Style Property Inheritance?
  16. What Is CSS Cascading?
  17. What Are the CSS Cascading Order Rules?
  18. How To Remove the Top White Space of Your Web Page?
  19. How To Set Different Text Fonts Inside Tables?
  20. How To Use Class Selectors to Differentiate Tag Instances?
  21. How To Use IDs to Override Classes?

Answers: CSS Tutorials – Introduction To CSS Basics

September 29, 2009 Posted by Vincent Leung | Design | | No Comments Yet

famfamfam.com ‘s 1000 Silk icons

 

Silk web icon set, with 1000 16×16 icons , including report icons, some new picture icons, some small XHTML/CSS buttons, and some hardware drive icons. The feed icons have been brought into line with new standard, and all icons have been compressed to lower the filesize. For the sake of my inbox and my sanity, I’m now calling this set complete.

Silk icon: Form
Silk icon: Address Book
Silk icon: Webcam
Silk icon: Valid CSS
Silk icon: Camera
Silk icon: Date
Silk icon: Exit
Silk icon: CD Drive
Silk icon: Feed
Silk icon: Lorry/Truck
Silk icon: Map
Silk icon: Add picture
Silk icon: Pictures
Silk icon: Report
Silk icon: Telephone

View all icons (.png file, 1Mb)

famfamfam.com: Home

September 9, 2009 Posted by Vincent Leung | Design, Tools | | No Comments Yet

75 Amazing CSS Navigations and jQuery Examples

August 14, 2009 Posted by Vincent Leung | Design, jQuery | | No Comments Yet

Jason Dolinger Model-View-ViewModel Screencast

 

Jason Dolinger’s a presentation on design in WPF(also applicable to Silverlight) with the Model-View-ViewModel pattern and the Unity dependency injection framework.

Jason started with an application that one would write in a “traditional” way, with button clicks handled by event-handlers in the code-behind that then updated other parts of the UI. Using WPF data-binding, Commands, and Unity, he transformed it, piece by piece, in a much more manageable, encapsulated, readable, and testable M-V-VM design. It was awesome.

 Screencast here.

Traditional way 6:00 – 13:00
MVP 13:30 – 17:00
MVVP     Overview 17:17 – 22:00
        Impl 22:30
        ViewModel 23:26
        ICommand 45:15
        Unit Test 51:30
        Moq Mocking Framework the DataSource 52:43 – 57:30
        Dependency Injection – Unity – App.xaml 57:45 – 1:09:45
        Static Data display in Expression Blend 1:10:15
        Create a Row-level ViewModels for Grid & ItemSources control 1:15:50

Note: Jason creates ViewModels that are DependencyObjects. However,DataContexts in Silverlight cannot be DependencyObject descendants. That means that you need to implement ViewModels as INotifyPropertyChanged.

Silverlight does not support bindings for Commands out of the box. It does, however, expose the ICommand interface. With just a little bit more work using an “Attached Behavior” approach, we can get the kind of Commanding that Jason uses in Silverlight as well. Check out the description here.

Via Jason Dolinger on Model-View-ViewModel » Lab49 Blog

February 11, 2009 Posted by Vincent Leung | Design | | No Comments Yet

PUT vs POST in RESTful Web Service

Let us use a bookmark service as an example.

 

image

We can use PUT to create new user accounts because the client is the one picking the username that forms the new resource’s URI. If the client is successful, the service will return a 201 (“Created”) response. If the client attempts to use an existing username, the service will return a 401 (“Unauthorized”) response. When issuing the PUT request to create a user account, the client will provide a user account representation in the HTTP request body containing the user’s information.

For individual bookmark resources, we’ll support GET, POST, PUT, and DELETE requests. If a particular bookmark is marked as private, only the owner can retrieve it, but if it’s public, anyone can retrieve it. When a user creates a new bookmark, the service is responsible for assigning it a unique bookmark Id. Hence, the client won’t know the Id to use in the URI ahead of time. So, instead of using a PUT request, we’ll have users POST bookmarks to the user’s bookmark collection resource.  The handler for the POST request will create the new bookmark, assign it an Id, and return a 201 (“Created”) to the client, specifying the URI of the new bookmark resource in the Location header.

This explains when to use POST or PUT for creating new resources. The answer ultimately lies in who is responsible for determining the new resource’s URI. If the client is in charge, the client can use PUT to the new URI (like we did for user accounts) and the service can return a response code of 201 (“Created”). However, if the service is in charge of generating the new URI, the client should POST the new resource to a factory URI like we’ve done for bookmarks. Then, the service can return a response code of 201 (“Created”) along with the URI of the new resource in the response “Location” header.

Once clients know the bookmark ID’s, they can issue PUT and DELETE requests to individual bookmark URIs to update and delete bookmarks.

December 18, 2008 Posted by Vincent Leung | ADO.NET Data Services, Architecture, Design | | 1 Comment

A Brief Introduction to REST

 

image

 image

Key REST principles

Most introductions to REST start with the formal definition and background. I’ll defer this for a while and provide a simplified, pragmatic definition: REST is a set of principles that define how Web standards, such as HTTP and URIs, are supposed to be used (which often differs quite a bit from what many people actually do). The promise is that if you adhere to REST principles while designing your application, you will end up with a system that exploits the Web’s architecture to your benefit. In summary, the five key principles are:

  • Give every “thing” an ID
  • Link things together
  • Use standard methods
  • Resources with multiple representations
  • Communicate statelessly

Let’s take a closer look at each of these principles.

Via InfoQ: A Brief Introduction to REST

December 17, 2008 Posted by Vincent Leung | Design | | No Comments Yet

CSS-Styled Lists: 20+ Demos, Tutorials and Best Practices

 

When we think about CSS-Styled lists, different ideas come to mind but that rusty old image of bulleted items is not one of them anymore. There are lots of different methods to format nice HTML lists that is used in most web designs not only for navigation menu (vertical or horizontal) but for formatting many design blocks in a stylish and elegant manner. In this article, we’ll have a look at how such lists can create a whole new look, feel, and effect of a site. Via – CSS-Styled Lists: 20+ Demos, Tutorials and Best Practices

You might be interested to check other CSS related posts :

August 11, 2008 Posted by Vincent Leung | Design | | No Comments Yet

CSS shorthand properties

April 17, 2008 Posted by Vincent Leung | Design | | No Comments Yet

Excellent CSS Tutorials on Selectors, Lists & Floats

April 17, 2008 Posted by Vincent Leung | Design | | No Comments Yet

Learn CSS Positioning in Ten Steps: position static relative absolute float

April 17, 2008 Posted by Vincent Leung | Design | | No Comments Yet