Posts

Tuning Costs on my Azure Development Machine

I’ve been storing my development machines up in Azure instead of buying a new laptop. And I really like this approach.  By far the most useful aspect is that I needed to completely rebuild a machine the other day to get my development tools all working properly. The conversion from an older version of my dev tools to a newer version did not go so well, and the solution turned out to be just moving to a new machine. In Azure this was trivial as I just fired up a new VM. But this is something you could do locally as well, and I’m wondering if I need to do that, because one thing I’m learning is that AZURE can be Expensive. Now by “expensive” it should be noted that I just hit $60/mo in my VM dev environment, so not actually that much money, but it’s an environment I only use a few hours per month for side work, so very expensive per hour. A couple of issues I’ve had: When you remove a VM, it doesn’t automatically remove the disks, which is maybe a good thing, but on a VM you on

Hiding an ASPXGridView Delete button with HTMLRowCreated vs. CommandButtonInitialize

It's pretty typical in Administration forms to need to hide buttons on certain rows for various reasons. Particularly it is nice to hide the Delete button if in fact the row in question is being used in other places in the app. This is a nice feature to let the user know up front that the row in question is in use, rather than them trying to delete it and getting a foreign key related error after the fact. For years now in DevExpress ASPxGridView's I have been handling this in the HtmlRowCreated event. And I have been doing it wrong. Before: protected void gridGiftCodes_HtmlRowCreated ( object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Data){ int commandColumnIndex = - 1 ; //Find the command column commandColumnIndex = e.Row.Cells.Count- 1 ; //assume it's the last visible colum //Get the command cell for this row GridViewTableCommandCell cell = e.Row.Cells[commandColumnIndex] as Gri

Log4Net Primer

My notes on Log4Net, which is a great logging utility I've been using in a lot of console apps lately. It's beautiful. References: Great Introduction Video by Tim Corey - the first 45 minutes were sufficient for me: https://www.youtube.com/watch?v=2lAdQ_QwNww&feature=youtu.be Tim Corey’s original article: http://www.codeproject.com/Articles/140911/log-net-Tutorial Official Documentation, very thorough: http://logging.apache.org/log4net/index.html Summary: log4Net is a great logging tool for .Net applications. You can log at different “levels” like Debug, Info, Warn, Error, Fatal, and send different levels of logging to different places. For example all messages could go to the console, but Error or Fatal messages can go to a log file or a database. The basic steps are: Add log4Net to your program via NuGet Configure log4Net settings in your App.config Configure various “appenders” for all the targets you want to log to, and what format of