I am just starting to learn about the code contracts library that comes standard with VS2010. One thing I am running into right away is what some of the contract clauses really mean.
For example, how are these two statements different?
Contract.Requires(!mycollection.Any(a => a.ID == newID));
Contract.Requires(!Contract.Exists(mycollection, a…
I am having a find a replace in a bunch of RTF documents, The basic pattern I need is
\{(?:\\\*)?\\field\\fldlock\{\\\*\\fldinst ?MERGEFIELD ?((?:\\.*?)?[\w\[\]]+?)(?:\\.*?)?\}(?:\{\\fldrslt\})?\}
However I then found out there could potentialy be a newline before each slash, so it turned in to this.
…
So I have the following code contained within an HttpModule in an application I've been asked to support:
app.Context.Response.ContentType = "text/xml";
app.Context.Items.Add("IpixRoomId", ipixRoomId);
app.Context.Items.Add("IpixId", ipixId);…
I was speaking to an experienced lecturer recently who told me he could usually tell which programming language a student had learnt to program in by looking at their coding style (more specifically, when programming in other languages to the…
When I run this snippet of code:
string[] words = new string[] { "foo", "bar" };
var results = from row in Assets select row;
foreach (string word in words)
{
results = results.Where(row => row.Name.Contains(word));
}
I get this…
I am switching from Intelligencia's UrlRewriter to the new web forms routing in ASP.NET 4.0. I have it working great for basic pages, however, in my e-commerce site, when browsing category pages, I previously used querystrings that were…
If I run a simple query in SQL Query Analyzer, like:
SELECT * FROM TableName
the Messages pane always produces a message like:
(30 row(s) affected)
If I run a stored procedure with many statements, the messages are useless because…
Hey guys, I know this question has been brought up numerous times, but I'm not quite getting the full implementation. As you can see below, I've got a form that I can dynamically tell how many rows to create. How can I create an…
I find I sometimes need to iterate some collection and make an ajax call for each element. I want each call to return before moving to the next element so that I don't blast the server with requests - which often leads to other…
I am having trouble displaying a webview. I have a webview inside a custom view. I load this custom view as a subview of the window, and then have an object controller linking a text field to the content of the web view. Once a…
Here is where the error is occuring in the stack:
public static IKSList<DataParameter> Search(int categoryID, int departmentID, string title)
{
Database db = new…
I have had a site up and running for quite a while, but I've just started getting the MAC failed error. Quite often too. While coding tonight I've noticed it 4 times or so. The host…
Recently I have migrated to the new dedicated server which is running on the same operating system - FreeBSD 8.2. I got a root account access and all permissions have been set…
I want to save a 2D array to a CSV file with row and column "header" information (like a table). I know that I could use the header argument to numpy.savetxt to save the…
Question says it all.
Can someone point me to an example of how they do the alerts at the top when a new message arrives or someone posts to my answers or I just have a…
I'm trying to hook up the click event on a jQuery image carousel's images so that it updates a select list in the same document and sets the "selected" option to…
I am learning GDI+ and I am trying to make a display window with scroll bars (so I can only see part of the image at a time and I can scroll around it). I have…
My team uses Sitecore 6 as content management system and then .Net to interface with Sitecore API. In many of our templates we make use of a Treelist. When…