October 2007


Back to some basics today.  These are probably my favorite Visual Studio keyboard shortcuts:

CTRL-K,C – comment selection
CTRL-K,U – uncomment selection

To invoke either command, hold down the Control key while hitting K and then either C or U.  These two are way up on my list because the ability to easily comment large sections of code makes me less likely to delete them when I feel they’re not necessary.  90% of the time I end up deleting the commented code anyway, but it’s nice to have for that other 10%.

There are many more shortcuts that are accessed using CTRL-K plus an additional key.  Here’s a pretty comprehensive list of all the shortcuts in Visual Studio 2003 and 2005.

Share this post: digg it | Email it |

Advertisements

Looks like Verizon is the first to roll out symmetrical access, at least in New England.  Currently the 15mbps down/2mbps up FiOS package costs about 50 bucks a month.  This new 20/20 service is currently priced at $65.  No word on when this will be offered in DFW, or whether or not the 20/20 service will actually deliver at least the 15/2 we should be getting currently.

Share this post: digg it | Email it |

Right before I switched to FiOS last winter, I started noticing some BitTorrent connection issues.  Sure enough, Comcast has been caught with its pants down.  The executive summary is that Comcast is spoofing reset packets to trick filesharing applications into thinking the connection to the remote peer was dropped.

This isn’t magically limited to illegal sharing only; it’s across the board. What’s more, even Lotus Notes packets are disappearing into the ether.  Money quote:

Gigi B. Sohn, president of Public Knowledge, said that Comcast’s actions demonstrate the need for legislation. “Add this incident to the Verizon behavior on text messaging and AT&T’s censoring of the Pearl Jam concert and it’s clear that the policymakers who kept saying, ‘Wait until there’s a problem’ before acting on legislation to keep the Internet free and non-discriminatory have to wait no longer,” said Sohn in a statement. “We have a problem, and it’s time to act on it.”

Share this post: digg it | Email it |

Sometime in the last day or two Santa GMail delivered an extra gig… they’re up to 3.75GB now.  Sweet.

At an academic/pointy-headed level it’s interesting to see how we’re slowly mass migrating back to the client-server model that PCs made obsolete not that long ago.  Just within the past few years it’s become possible to do just about everything with a stripped-down PC and a web browser.  With absolutely no basis in rationality, fact, or research, I believe that in the next few years the consumer PC market will shift to a sharply divided two market model – very high end and very low end.  With online storage capacity and broadband speeds increasing exponentially, the need for end user horsepower is fading.  Why spend three grand on a new machine when you can:

  • slum it ($300-500)
  • do everything online ($0)
  • enjoy the same user experience on any net-connected PC on the planet ($priceless)

Crazy times.  Wouldn’t have them any other way.

Share this post: digg it | Email it |

Have you ever generated code at runtime using Reflection.Emit()? Neither have I. It’s very complicated and I haven’t had a compelling-enough reason to attempt it. A developer by the name of Stefan Simek has created a brilliant API called RunSharp (or Run#) which wraps the native C# Emit() functionality with an infinitely easier to use facade.

Let’s say you want to generate a class with a single public method. At design time this is easy enough:

public class MyClass
{
public void Main(string[] args)
{
// do stuff
}
}

I’m not going to post what it would have been like using out-of-the-box reflection in C#, but let’s assume that it is the giant pain in the ass that it really is. Now here’s the Run# version:

AssemblyGen ag = new AssemblyGen(“MyExecutable.exe”);
TypeGen myClass = ag.Public.Class(“MyClass”);
CodeGen g = myClass.Public.Method(typeof(void), “Main”, typeof(string[]));
Operand args = g.Arg(0, “args”);
g.WriteLine(“// do stuff”);

Share this post: digg it | Email it |

And suddenly 4th grade comes rushing back like it was yesterday.  If you have time check out the comments at the end of the articleFear the turtleLike many of the posters, LOGO was my introduction to the world of programming. That was followed by BASIC on the Atari 400, and then object scripting in the text-based BattleTech 3056 (my old nemesis – usurper of all free time and overzealous decrementer of freshman GPA).  Wonder where we’ll be in another 20 years…

Share this post: digg it | Email it |

In a previous post I talked a little about the Conditional attribute in the System.Diagnostics namespace. To briefly recap, decorating a method with [Conditional(argument)] will instruct the compiler to include the method only when argument is defined. If you’re interested in learning more, Mike Stall has a detailed examination of this attribute and various gotchas here.

Share this post: digg it | Email it |

Next Page »