Wow, I’m still alive! I installed the RTM of Windows 8 when it became available, and in the last few days have started taking a look at writing a windows 8 app using HTML/JS, which in and of itself is a weird thing. I don’t think that windows developers of 10 years ago would’ve thought something like this would have ever come about. As I was working on this, I ran across a problem, found the solution, and thought I’d blog about it to try and kick start me back into blogging. I already answered my ......
Hey there! So recently I was struggling with something for the new job, and was able to figure it out, and thought I'd share it with you, dear readers. I have a generic class I use for parsing data. Inside that class, I ran across the need to create another instance of the generic class to parse more data, but I didn't know the type at compile time. So I have this class: public class MyClass<T> where T: class { public void DoSomething() { } } In the course of DoSomething, I need to create a ......
Recently I was trying to use StringBuilder.AppendFormat to build some javascript, and was hit with an exception when trying to do this: sb.AppendFormat("function {0}(args) { return false; }", someVariable); The problem is that you can't have { or } inside an input string for string.Format(). The solution is actually fairly straightforward: sb.AppendFormat("function {0}(args) {{ return false; }}", someVariable); Instead of using "\" as an escape character, you would use { or } (depending on what you ......