Posts

  • Design by Contract should become this decades TDD

    I am currently taking CSE 218 at UCSD, “Advanced Topics in Software Engineering - Methods and Tools for Software Modularity”, where we recently read the paper “Applying ‘Design by Contract’” by Bertrand Meyer. I already knew a little about the concept, and after reading that paper and playing with the concept in a micro project, I am sold. I really think Design by Contract has a chance at being this decades TDD. It is pretty clear to me why it is a good idea to do “Contract First” development. Let me try to explain why.

    Read more - Comments

  • RIP Steve Jobs (1955 - 2011) – thank you for all your contributions

    It is not often I find myself struck by the passing of a public figure, but with Steve Jobs it is hard not to feel touched. The man who has had such a great influence on the tech industry and the world in general, leaves us with a large collection of important innovations and ideas, that will continue to inspire for many years to come.

    I will leave you with this fantastic quote from his Stanford Commencement Address in 2005.

    “Remembering that “I’ll be dead soon” is the most important tool I’ve ever encountered to help me make the big choices in life. Because almost everything – all external expectations, all pride, all fear of embarrassment or failure – these things just fall away in the face of death, leaving only what is truly important. Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose. You are already naked. There is no reason not to follow your heart.” – Steve Jobs

    Comments

  • Drupal: Extending Markdown syntax to add CSS classes to images

    Update June, 2013: As pointed out by Don Morris in the comments, PHP Markdown Extra now supports classes, making the below trick obsolete for this purpose.


    If you are using input filters such as the Markdown filter module, you may run in to a situation where the script behind the module does not provide you with all the formatting options you want.

    Read more - Comments

  • Getting all DNS records form a Internet domain via nslookup

    This is a quick and easy way to grab all DNS records from a domain. All you need is the name of the domain you want to query and the DNS server that is handling the domain. Here is how you do:

    Open up a command prompt and type:

    C:\> nslookup - your.dns.server
    

    In the nslookup prompt, type:

    > set q=any
    > ls -d domain.name
    

    Hope this helps.

    Comments

  • How to package fonts in .msi file for easy deployment

    In this tutorial I will show you how to package custom font(s) into a Windows Installer .msi package for easy deployment to computers in a network through Active Directory. Alternatives is to use a VBscript solution or batch file solution, but I like this solution better as it allows me to deploy it through a AD group policy, it will automatically ensure that the fonts is only installed once, and should I ever want to remove the fonts from all the computers again, it is just a matter of updating my AD group policy. The Windows Installer technology handles the rest.

    Read more - Comments

  • Simple Ping/Reply Service for Unit Testing AJAX/XHR requests

    To make it easier for me to unit test a OData JavaScript library I am working, I created a small HTTP handler that will reply back to a AJAX request with the headers, HTTP verb and query string it received. My initial thought was to do this through a WCF service, and while this is certainly possible, I found it much easier just to create a simple HTTP handler.

    Read more - Comments

  • How to take control of style sheets in ASP.NET Themes with the StylePlaceholder and Style control

    The problem is pretty simple. When using ASP.NET Themes you do not have much say in how your style sheets are rendered to the page.

    The render engine adds all the style sheets you have in your themes folder in alphabetic order, using the <link href="..." notation.

    Read more - Comments

  • Simply way of adding a default item to a data bound DropDownList

    I have always found it too difficult to add a “Choose xxxxx” item to the top of a DropDownList, when the DropDownList binds to a ObjectDataSource, SqlDataSource or similar. I almost always ended up just feeding the DropDownList its content from the code behind, even though it felt like something that should be possible directly. The control do have a AppendDataBoundItems property, but most of the time you just end up with duplicated items.

    Read more - Comments

  • System.Diagnostics + ASP.Net Web Site – remember to set compilerOptions="/d:TRACE"

    Today I was looking at Ukadc.Diagnostics, an extension to the System.Diagnostics namespace, and decided to build a test website myself to get more familiar with it. After reading through Ukadc.Diagnostics Reference Example I thought it would be a homerun in the first try, but it turns out that without adding compilerOptions="/d:TRACE" to each compiler in the compilers section in the Web.config, the tracing code is never compiled into the assemblies at runtime. Needless to say, I was scratching my head since my sample console application worked as expected the first time.

    Read more - Comments

  • C#/.NET: Safe way to convert UTC time to local time when databinding

    After reading Scott Mitchell’s article Using Coordinated Universal Time (UTC) to Store Date/Time Values, I decided to do as he suggest and use UTC for a web application I’m building at work. All in all it is fairly easy to deal with UTC in the .NET Framwork. There is a DateTime.UtcNow you can use instead of the regular DateTime.Now property, and there is a DateTime.ToLocalTime method that will convert your UTC DateTime value to the local server time zone, even taking daylight savings time in to consideration. When converting the other way, the DateTime.ToUniversalTime method is provided.

    Read more - Comments

← Previous page - Next page →

Mastodon