We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution
Learn MoreThis is the fourth post in the series of programming job interview challenge. Today, I will provide the answer to job interview challenge #3, talk about readers answers (all of the comments are now approved) and give you a new challenge. So, lets get into business:
The correct answer to challenge #3:
Hi all
As you might have noticed we have just tweaked our theme again. During the past month we made some theme changes and tests, but now we think we finally got something we like!. We are sure that the new design will makes Dev102 much more “Easy on the eyes” :).
Hope you all like it as much as [...]
I am currently working on a project with a pluggable application (load plugins at runtime and execute them) that loads assemblies at runtime, using the Assembly.LoadFile() method. I wanted to test it using NUnit (feel free to read our 3 Ways to Run NUnit from Visual Studio post). Although, the code was functioning very well it always failed during the NUnit tests, always! It took me several days to understand what went wrong and I want to share you with my findings.
Did you ever need to convert List(T1) to List(T2)? One example might be when implementing an interface. you might need to expose a collection of other interfaces (or maybe the same interface), But you usually hold the concrete type implementing the interface in the collection. Lets look at the following example:
Last week I was faced with a problem. I needed to implement a MouseDoubleClick Event on a WPF Grid. I said Ha, easy but as i went on to implement it i realized that the Grid has no MouseDoubleClick Event! So how am I supposed to implement it? I came up with 2 solutions and so here goes:
<UserControl x:Class="CustomDoubleClick.GridWrapper" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="300" Width="300"> <Grid> </Grid> </UserControl>
List<T>.Find() returns the first element found that matches a given criteria. So lets say we have List<int> and we use the Find method on it. What will be the returned value? If a number in the list matches the criteria it will be returned, but what if not? what does the variable zero contains after executing this code:
List<int> listOfInts = new List<int>(new int[] { 1,2,3,4,5,6,7,8,9}); int zero = listOfInts.Find( delegate(int i) { return i == 0; });
It has the value of…
This post is third in the series of programming job interview challenge, if you are not yet familiar with these series please take your time and read:
Well, last weeks challenge was very successful, all of the comments which contain answers to the question are now approved and can be viewed in challenge #2 post.
Here is a list of 6 Visual Studio tweaks you can do to make your development experience much better:
Show shortcut keys in screen tips:
Go to Tools->Customize and choose the Toolbars Tab. This screen pops up-

ASP.NET provides mechanisms for storing information for a single user session or across multiple sessions. This is done using the HttpSessionState and HttpApplicationState classes. The Page class has Application and Session attributes to provide access to current objects. The simple way to access them is as following:
if (Session["FirstName"] == null) { LabelFirstName.Text = "FirstName"; } else { LabelFirstName.Text = (string)Session["FirstName"]; } if (Session["LastName"] == null) { LabelLastName.Text = "LastName"; } else { LabelLastName.Text = (string)Session["LastName"]; }
Since we got so many comments with lots of useful information on our Visual Studio Shortcuts post we decided to use those comments and some other shortcuts we found and compile another list so lets get going
Copyright © 2012 Dev102.com
Breeze : Designed by Amit Raz and Nitzan Kupererd