Directory Freebies VS CheatSheet Forum

RSS

Email

Translate

Home About Archive Privacy Contact Advertise Guest Post
Posted by Shahar Y on Dec 29th, 2008 | Filed under .Net, ASP.Net, C#, Unmanaged Code, Visual Studio | 3 Comments

bugs

We all know what breakpoints are, they tell the debugger that an application should break and pause execution, at a certain point. If we want to get certain information at this point, we need to copy it down to a paper or to the notepad. There are breakpoints which get hit hundred of times during the execution of a program, so it may be very exhausting to write down the breakpoint information each time it is hit. Well, last week, while I saw John Cunninghams session at PDC 2008 about Visual Studio Debugger Tips & Tricks, I learned something new. The Visual Studio debugger has another feature called tracepoints.


Continue Reading...
Posted by Amit on Dec 24th, 2008 | Filed under .Net, C# | 6 Comments

Hi all

 

I was into filtering items lately :) and I have decided to write about some of the techniques out there starting with the old

 

The good old Foreach

Well we have all used this before once you get a list in your hands just iterate through all the items and select the ones you want:

   1: private static List<int> TheOld_FilterPositiveItems(List<int> t)
   2: {
   3:     List<int> ret = new List<int>();
   4:     foreach (int i in t)
   5:     {
   6:         if (i > 0)
   7:         {
   8:             ret.Add(i);
   9:         }
  10:     }
  11:     return ret;
  12: }

I hope you are not using this method. As there are other good methods like this one:

 


Continue Reading...

From Wikipedia: “A deadlock is a situation wherein two or more competing actions are waiting for the other to finish, and thus neither ever does”. Deadlocks are terribly difficult to find and even more difficult to debug. Debug Inspector is a free tool that allows you to view the call stacks of multiple threads at the same time, plugs in to the internals of the CLR and automatically detects deadlocks.

 

The most powerful feature of this tool is that it works on both managed and unmanaged code. It is actually a Visual Studio extension which can be used to detect managed deadlocks and a standalone executable to detect unmanaged deadlocks. Besides detecting deadlocks, there are more features to this tool:


Continue Reading...

There are a number of articles present on the Internet showing different ways to develop a sitemap. Most of them use a tree view and a sitemap file but the output rendered usually is clumsy, unstructured and not in a table manner.

Here in this article I have made an attempt to display a sitemap using nested DataList and web. Sitemap file.


Continue Reading...
Posted by Shahar Y on Dec 16th, 2008 | Filed under Unmanaged Code | Leave a Comment

If you have read the Unhandled Exceptions - Handle Them article, you are already familiar with unhandled exceptions in C#. Most people don’t really know that C++ also, have a mechanism to allow a clean termination of our program. I am writing this post to introduce you with that mechanism.

 

When an exception is unhandled by our program, no cleanup occur, meaning the destructors are not called. Moreover, you may want to do operations such as logging or presenting a friendly screen announcing about the occurrence of a problem. Wrapping out Main function with a Try Catch(…) block is not recommended due to performance issues. Fortunately, the…


Continue Reading...
Posted by Amit on Dec 10th, 2008 | Filed under C#, WPF | 3 Comments

A while back I needed to add a double click event to a control that had no such event. The solution I came up with was to wrap that control inside a UserControl and use the UserControl’s DoubleClick event.

 

One of the readers commented about a better way to do it using Command Binding, here is what David N said:

You can also do this by adding an InputBinding to the Grid, that will translate a double click to an invocation of a RoutedCommand, then you can bind that to some handler code somewhere higher in the tree. Commands seem to be a neglected part of WPF, but are really quite useful especially if there are multiple actions that should end up triggering the same code (button, toolbar button, context menu, key combination, double click in the grid..). I just used a builtin command in this sample but of course you’d probably use a custom one.

I was faced with the same problem last week so I decided to give it a shot.

 


Continue Reading...

In the first part of this series we didn’t really look at the MVC framework. We talked about what it is and what it does but didn’t look at any code. We did however plan out what we wanted our application to do and created our database schema that will support our application. In this part we are going to jump in and get an MVC Application created and look at the Model portion of the application. We’ll create our domain objects and data repositories. It is important to note that I will be using the Repository Pattern with Pipes and Filters Pattern. So we’ll have our data repositories and their relevant filters. We will then create data service objects that encapsulate the repositories. Also, I will be using LINQ To SQL to interact with the database. If you prefer a different method of data access feel free to use something else. Finally, before we get started, I will not be writing unit tests for this series, at least not showing them in the posts, in order to keep things simple and to keep the posts from getting too long.


Continue Reading...

Happy Birthday!!!!!

 

Today is our one year anniversary! Yes! Dev102 is one year old! Thanks everyone for reading and commenting!

 

Tweeter

A reminder: we would love it if you followed us! So come on,

Follow Us on
Twitter

 

Guest Posting

We would like to remind you that if you want to earn quick 30$ just drop a good post in our mailbox and that’s it! We will gladly discuss articles topics in advance, read more about it on our Guest Posting Page We would also like to help all you guys who are developing free tools by giving you the option to write guest post about it here on Dev102. So If you have a FREE tool you are working on, and you would like to give it some publicity, come and talk to us.


Continue Reading...
Posted by Shahar Y on Dec 5th, 2008 | Filed under .Net, C#, Misc. | 1 Comment

Today I am going Alvin Ashcrafts and Chris Alcocks way and publish a lists of blog posts I liked. I don’t tend to do this a lot and actually, this is only the second time. So, here is the list of posts which I liked reading and wanted to share with you:

  1. Do NOT Explicitly Use Threads for Parallel Programming - Daniel Moth advise us to never explicitly use threads for parallelism, but to partition our work into many small chunks in another way.
  2. An easy and efficient way to improve .NET code performances - Patrick Smacchia present an efficient optimization on something we all use massively: loops on collections.

  3. Continue Reading...
Posted by Shahar Y on Dec 3rd, 2008 | Filed under .Net, C#, Unmanaged Code | 8 Comments

Is it OK to throw exceptions from constructors? Some of us may have heard that it is wrong but don’t really remember why. There are lots of philosophical arguments about this question, you may become confused trying to understand what’s the right thing to do. Does it mater if we are developing with C++ or any other .Net language like C#? I am writing this article to shed some light on the “throwing exceptions from constructors” topic. 

 

Constructors can’t return values, so we pretty much have to throw an exception to indicate that the object couldn’t be constructed. Some of you may grasp that constructors are supposed to handle simple tasks…


Continue Reading...
Advertise on Dev102 Bitrix Site Manager

Read reviews and compare prices on : Laptops , Software Like Windows, Office Suites & Many More.

Advertise on Dev102
Write Article for Dev102

Write for us!

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

Learn More