Apr
30th

Call ASP.Net WebMethod from jQuery

Posted by Shahar A |
Filed under ASP.Net, Web Development |

I’ve read about jQuery in this great post Five recommendations for starting a startup with ASP.NET and wanted to play with it and see
how easy it is to call a WebMethod from
sQuery. I Started by reading some of the great Tutorials and downloaded the code from here.
I Created a test web project, copied the jQuery [...]


Continue Reading...
Apr
29th

A Great Visual Studio Add-on You Must Have

Posted by Amit |
Filed under Utilities, Visual Studio |

Recently I found out this great add-on for Visual Studio 2008 called PowerCommands. PowerCommands Extends the functionality of Visual Studio 2008 by adding some features which we all want built into Visual Studio. PowerCommands provides the following:

My favorite: Copy Reference, very useful indeed, and you all know it, just right click on the reference you [...]


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
25th

LINQ to XML in 3 easy steps

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

Linq to xml provides an easy query interface for XML files. In the following example I will demonstrate how to use it for reading and writing data from/to xml file, using the file for persistency maintaining a list of objects. This can be used for storing application settings, storing persistent objects or any other data [...]


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
22nd

Is [Serializable] == ISerializable? No!

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

Serialization is the process of saving an object onto a storage medium (such as a file, or a memory buffer) or transmiting it across a network connection link in binary form.
The .NET Framework provides an easy-to-use serialization mechanism by using the [Serializable] attribute. If so why do we need the ISerializable interface? Lets compare to see [...]


Continue Reading...
Apr
21st

A Bug in WPF Static Resources?

Posted by Amit |
Filed under C#, WPF |

Yesterday I played around with WPF resources and stumbled on a very strange behavior. It seems that the order of the elements in the resources have some importance as to how the application handles them. A few code examples are attached


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
17th

10 Visual Studio Shortcuts You Must Know

Posted by Amit |
Filed under Visual Studio |

This is a list of 10 great shortcuts me and my co workers use frequently, we thought you all should know too. Here they are:

CTRL + “.”: This is actually a shortcut for a shortcut. it is the same as CTRL + SHIFT + F10 which opens the smart tag window and allows you to [...]


Continue Reading...