Archive for the ‘Programming’ Category

Error: Web Server not running ASP.Net

c:\windows\microsoft.net\framework\v1.1.4322\aspnet_regiis -i   — this is the path to the older version, but I believe it still happens in newer versions as well, if ASP.Net and the Dot Net framework are not installed in the right order.

Advertisements

Odd and Even

This is a well-known programming fact, but since it came up today and I had to double check the C# syntax:

If you have many iterations in a loop, and you want to know if the current number is odd or even, the easiest and most natural way to tell is probably the modulus operator. However, that requires division. Computers are faster at addition and multiplication than they are at subtraction and division. Bitwise operations are also faster and easier for the computer than division. Therefore, a bitwise AND to 1 is the faster and more efficient way to tell if a number is odd or even. C# example:

for (int i = 0; i < 100; i++)
{
     result = String.Format(“{0} is even”, i);
     if ((i & 1)==1)
     {
          result =
String.Format(“{0} is odd”, i);
     }
     Console.WriteLine(result);
}

Wireshark

Just started using Wireshark to read network traffic for BACnet.

I set the capture filter to “ether host xx:xx:xx:xx:xx:xx” to read only traffic for a certain device. If you use a display filter instead of a capture filter, it captures all the network junk. The tighter the capture filter, the better.

 I have also set the display filter to “bacnet.version > 0” in order to see only BACnet traffic. I am sure there is a better way.

Branching

Channel9 did a video about branching with Brian Keller, of Team Foundation Server.

Continue reading

Virtual Grids and OnCellMouseEnter events

Quick view: Changing the image in a DataGridViewImageCell to make it  act more like a button.

Continue reading

DateTime Best Practices

Dan Rogers wrote a paper in 2004 about DateTime best practices.  http://msdn.microsoft.com/en-us/library/ms973825.aspx (Edit: I updated the link.) Here are some interesting points.

Continue reading