May
12th

A Programming Job Interview Challenge #3

Posted by Shahar Y |
Filed under .Net |

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:

  1. A Programming Job Interview Challenge
  2. A Programming Job Interview Challenge #2

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.


Continue Reading...
May
9th

6 Useful Visual Studio Tweaks You Need To Know

Posted by Shahar Y |
Filed under .Net, Visual Studio |

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-

image


Continue Reading...
May
5th

A Programming Job Interview Challenge #2

Posted by Shahar Y |
Filed under .Net, C# |

Job Interview ChallengeLast week I posted A Programming Job Interview Challenge which was very successful, both in the amount of page views and, in the amount of comments and mails we received. This fact made us (the Dev102 team) decide to add a weekly programming job interview challenge column to www.Dev102.com.


Continue Reading...
May
1st

Operator~ and BinarySearch

Posted by Shahar Y |
Filed under .Net, C# |

Usually, we use Array.BinarySearch to find a value in a sorted array, we all know that this method returns the index of the searched value in the array, if value is found. It turns out that the return value of BinarySearch is much more interesting and useful. Lets focus on what happens if the value is not found in the array.

Those who claim that if value is not found than a negative number will be returned, are absolutely right. But most of us don’t really know the whole truth about that negative number and how it can be used.

magnifying-glass


Continue Reading...
Apr
28th

A Programming Job Interview Challenge

Posted by Shahar Y |
Filed under Unmanaged Code |

Recently, I ran into an interesting job interview question in C++ which I want to share. Lets take a look at the following code:

// Option A. 

char str1[] = “example”;  

str1[1] = ‘a’;  

// Option B.  

char* str2 = “example”;  

str2[1] = ‘a’;

What would happen if we compile and run this code ?


Continue Reading...
Apr
24th

A Great XPath Query Tool

Posted by Shahar Y |
Filed under .Net, C#, Utilities |

XPath is a language for addressing parts of an XML document, for those who are not familiar with this language - here are the W3C specifications and here is the W3schools tutorial. Now that we know XPath, lets get to the point of that post which is - Visual XPath.

This is a free graphical XPath [...]


Continue Reading...
Apr
23rd

WPF DataTemplate for Interfaces? Not Supported

Posted by Shahar Y |
Filed under .Net, WPF |

DataTemplates are a great feature introduced in WPF, it allows to determine how data is presented and how data binding accesses the presented data. Just as we can apply a visual style to a specific UI control, we can do it for a specific data type. There is just one problem here, DataTemplates are good [...]


Continue Reading...
Apr
18th

Don’t Use Double.Nan

Posted by Shahar Y |
Filed under .Net, C# |

Comparison of a double with double.Nan (Not a Number) will always return false. Even (double.Nan == double.Nan) return false and indeed, from IEEE 754 specs: equality comparison between two Nan is always false. If we want to check whether a specific double is Nan, double.IsNan() shall be used. Lets look at how the IsNan [...]


Continue Reading...
Apr
14th

Unhandled Exceptions - Handle them

Posted by Shahar Y |
Filed under .Net, C#, Unmanaged Code |

It is common knowledge that there is no such thing as software without bugs. There are several bugs out there that are hiding and therefore are not handled at all. We surely don’t want to release a software that will crash ungracefully due to such a case. Fortunately, the .Net framework makes it possible to [...]


Continue Reading...
Apr
11th

Free Tool - Extract Hard Coded Strings to Resource Files

Posted by Shahar Y |
Filed under .Net, C#, Utilities, Visual Studio |

Recently, I ran into a great free Microsoft tool which is called - Resource Refactoring Tool. This tool provides developers an easy way to extract hard coded strings from the code to resource files.
Resource files (.resx files) consists of XML entries, which specify objects and string inside XML tags. Those files can be opened with [...]


Continue Reading...