Directory Freebies VS CheatSheet Forum

RSS

Email

Translate

Home About Archive Privacy Contact Advertise Write for Dev102
Posted by moshe on Jul 28th, 2009 | Filed under .Net, C# | 5 Comments

Last week, I stumbled upon the following piece of code:

 

IList<double> doubles = new List<double> {22.123, 400.12, 100.22};
foreach (int number in doubles)
{
    Console.WriteLine("The Current Number Is : {0}", number);
}

Can you see the bug in that code? We convert all of the doubles in the list to integers, truncating them. I was very surprised that the compiler didn’t warn me about this issue, especially because the compiler would not let me write this code:

 


Continue Reading...
Posted by ailon on Jul 23rd, 2009 | Filed under .Net, C#, Silverlight, WPF | 7 Comments

Suppose you have several objects in your WPF application filled with similar Brushes which differ in brightness only. Like in this image:

red_rect

 

The nine rectangles use the same RadialGradienBrush but each rectangle is a little darker than previous. You can create these 9 different brushes in your favorite design tool (Expression Blend, etc.). But what if you need to change the base color later or you just need to make the brush user-configurable? Like in these samples:


Continue Reading...
Posted by Justin on Jul 17th, 2009 | Filed under C# | 4 Comments

What is REST?

Representational state transfer (REST) is a style of software architecture for distributed hypermedia systems such as the World Wide Web. As such, it is not just a method for building "web services." The terms "representational state transfer" and "REST" were introduced in 2000 in the doctoral dissertation of Roy Fielding,[1] one of the principal authors of the Hypertext Transfer Protocol (HTTP) specification.

REST is a method of managing resources over HTTP. There are a number of methods of interacting with resources via REST.

HTTP CRUD
POST Create
GET Read
PUT Update, Create
DELETE Delete

Systems which follow Fielding’s REST principles are often referred to as "RESTful".

 


Continue Reading...
Posted by Amit on Jul 12th, 2009 | Filed under C# | Leave a Comment

Hey all
 
I am sorry for the long absence but I just got married and went on a great honeymoon, so I was not around!
 
I hope things will start to pick up from now.
 
Just wanted to let you all know that we are back online, and to tell you that we have updated the Write [...]


Continue Reading...
Posted by Amit on May 28th, 2009 | Filed under .Net, WPF | 5 Comments

Hi

 

When working with WPF I always found myself thinking how to handle Data formatting when a WPF control was bound to it. Let’s look at the following example of a window with a TextBlock that displays a DateTime:

   1: <Window x:Class="BindingFormat.Window1"

   2:     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

   3:     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

   4:     Title="Window1" Height="300" Width="300">

   5:     <Grid>

   6:         <TextBlock Text="{Binding}"></TextBlock>

   7:     </Grid>

   8: </Window>


Continue Reading...
Posted by Amit on May 25th, 2009 | Filed under .Net, Silverlight, WPF | 1 Comment

This article was written by Alan Mendelevich

The Problem

Creating a shape with bullets on the joints of it’s segments sounds like a really trivial task at a first glance. Just plaster some bullets on top of the shape. And it is really something like this until you decide you want to have transparent outlined bullets or opaque bullets with transparent outline around them. Like the ones in this picture:

bulleted_path_samples

 


Continue Reading...
Posted by Shahar Y on May 19th, 2009 | Filed under .Net, C# | 1 Comment

Let me share you with one of the weirdest errors I ever encountered. Recently, I have been working on a distributed application which is built from a server and some clients. The clients are Windows Forms applications. Yesterday, I spent a whole day chasing a very weird and strange error - I was getting an exception at the main method (unhandled exception) of the client application. Here is what I got:

image

The error description was:


Continue Reading...
Posted by Amit on May 4th, 2009 | Filed under .Net, WPF | Leave a Comment

This article was written by Alan Mendelevich

 

Hi

 

Recently I’ve been working on a set of custom WPF controls.

There are numerous good books and articles about WPF in general and some basic information on custom control development but I have yet to find a good article (or book) with in-depth coverage of custom control development in general and design-time related issues in particular.

 


Continue Reading...
Posted by Justin on Apr 28th, 2009 | Filed under Web Development | 3 Comments

JQuery has simplified a lot of my day to day coding. I think it is an amazing little framework and apparently a lot of people do too. Even Microsoft is bundling it with its ASP.NET MVC framework which , as far as I know, a first for open source software. Beyond even handling all the all of the cross browse mess, my favorite part of jQuery is the ability to easily extend the framework through plug-in. That brings us to the topic for this post. We are going to look at how easy it is to create a plug-in for jQuery.

What Will Our Plugin Do?

For this post I want to pick something that is fairly simple yet demonstrates the power of plugins. For this post I am going to show you how to create a plug-in that will highlight keywords in a given block of text. Many websites use something similar when performing searches.


Continue Reading...

Hey all,

 

a while back we had 2 great posts and one page about visual studio shortcuts. The first one had a list of 10 Visual Studio Shortcuts and the second one had 11 Visual Studio Shortcuts. We also have a Visual Studio CheatSheet with all the Keyboard shortcuts Visual Studio has.

 

Here is another list of 5 Shortcuts I have picked up along the way.

 


Continue Reading...
Write Article for Dev102

Write for Dev102!

We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution

Learn More