Collections can be tricky sometimes when you’re writing code. This is especially true when you need to modify them while you’re looping through them. Let’s look at a couple examples that can get you into trouble. //create a typical list of items List<string> items = new List<string> { "first", "second", "third", "fourth" }; //now clear ...
This post discusses the basics of writing your own dynamic type – If you’re interested in the finished code make sure to download the source. The new dynamic keyword is a great way to create and modify a dynamic object in your .NET code – For example, check out this bit of code. dynamic counter ...
I came across a weird issue working on some code this weekend. Everything had been moving along fine in my project but then I encountered a problem. Of course, being a big fan of the debugger, I immediately placed a break point in the suspect line of code, pressed F5 and then… nothing. No debugger, ...
Yes, it seems impossible so I took a screenshot. My little jsshell project has made it onto a pretty ‘notable’ list of Google extensions. If you don’t know what jsshell then you might watch the introduction screencast. Well… yeah, it isn’t spelled correctly… but I promise it is the same one. In any case, you ...
Unless you’re really hardcore you probably use an IDE with some sort of autocomplete feature. It doesn’t have to be the super charged intellisense you find in Visual Studio – It could be as simple as the autocomplete feature in Notepad++ (which I love by the way…) In any case, I got to wondering today ...
“Don’t change your code unless you know how it will fix your problem”. If I had to pick a quote to put a ‘squiggly line and my name’ next to, then this would be it. I’ve seen developers stare blankly at an exception message, comment out a line of code or two and then try ...
One thing I try to avoid in interface design is unnecessary user interaction – Basically, asking the user for feedback when it isn’t needed. The area that probably bothers me the most are “confirmation boxes” – Especially those that block the entire application until you’ve clicked ‘OK’? I’m not really sure why you see them ...
CobaltMVC is a server side templating framework that behaves just like jQuery for your Views. CobaltMVC also works in WebForms. CobaltMVC supports a variety of CSS selectors including pseudo and attribute matching. To keep things flexible, I’ve made it so that you can create or overwrite anything built-in. This post we discuss how to create ...
CobaltMVC is a server side templating frameworks that works a lot like jQuery. You can use it with both ASP.NET MVC and WebForms – (Watch the introduction video) So far all of the CobaltMVC examples that have been posted have involved selecting existing elements on the page and making changes to them. However, there are ...
In a recent blog post I shared a preview of the Cobalt project I’ve been working on. Today, the source code has been uploaded to git-hub and the first beta binaries are being released! Not sure what Cobalt is? Watch a screencast showing how you can use Cobalt in your MVC projects. Watch the video ...