Multi-line Regular Expression Replace in Powershell

PowerShellWindows Powershell offers advanced command-line scripting, bringing the .Net framework to traditional batch files.  One of its primary drawbacks, however, is the scarcity of good documentation available for the language.  The regular expression engine, while powerful, has a custom, often undocumented syntax for advanced operations such as multi-line search and replace.

Multi-line regular expressions are particularly useful when parsing HTML or XML documents.  Since XML elements can contain multiple lines between their opening and closing tags, a more flexible engine is required when parsing and altering these documents.
Continue reading

RSS Twitter LinkedIn Facebook Email

Dynamically Installing .NET Prerequisites

.NET DevelopmentWhile .NET ClickOnce applications offer simple tools for publishing applications and automatically handling dependencies, there are occasionally hiccups in the dependency management.  Instead of automatically installing all dependencies in one run, for example, the program might require several attempted runs to install the prerequisites one-by-one.  At other times, the prerequisites might not be properly packaged with the application, or require a custom installer to run.  In these situations, manually handling the prerequisite management can offer ease-of-use and more control over deployment.
Continue reading

RSS Twitter LinkedIn Facebook Email

C# DirectX – Automatic Graphics Card Fallback

3D GraphicsWhen developing 3D graphics applications, one of the recurrent challenges that plagues developers is balancing great graphics with end-user compatibility and reach.  The more complex the graphics techniques utilized by the application, the fewer end-users will be able to actually run the software.  With the explosion of mobile technology on slow and low-power hardware, 3D graphics are even further limited than they were years before.

In order to achieve a compromise between compatibility and graphics quality, a technique called Shader Fallback enables developers to switch to lower-quality graphics when necessary.  This enables users with high-powered PCs to run the software at its maximum specifications, while simultaneously providing users on slim hardware with functional access the content and interface of the application.
Continue reading

RSS Twitter LinkedIn Facebook Email

Website Security Vulnerabilities: Cookies

CookiesIn the dark ages before the rise of the Internet, application security had once been a comparatively minor concern in software development lifecycle.  Most programs were completely internal to a company, and unavailable to public access through telephone or modem.  A large portion of applications had no network connectivity whatsoever, and resided solely inside a user’s PC.  In this environment, junior developers could rarely cause serious damage to the IT infrastructure.  While a foolish mistake could delete an important table or database, these errors were relatively easy to fix through a restore operation, and security permissions helped make this a rare occurrence.
Continue reading

RSS Twitter LinkedIn Facebook Email

Software Design Patterns in C#

Design PatternsYet another series of design patterns in C#? Has the world not seen enough dry and thoughtless regurgitations of the GoF? Yes and no.

What started out as a thoughtful attempt to categorize good principles of software design by a roving band of computer scientists named the “Gang of Four” has turned into the poster child of the Bloated Code movement. Vexilla Regis prodeunt Inferni. Decorators and Observer patterns for all!
Continue reading

RSS Twitter LinkedIn Facebook Email

Multilingual Web Architecture

Multilingual Web DesignWhen developing websites for global brands, a key component of a site’s success is its multilingual and region-based capabilities. Global sites need to appeal to audiences across national and cultural borders, targeting their brand and marketing approach to the needs and personalities of the local audience.
Continue reading

RSS Twitter LinkedIn Facebook Email

Simply Integrating Open Source Packages

MagicAh, the tempting lure of open source packages. The El Dorado of software development, open source packages promise all of the advanced features users crave with absolutely none of the cost. The software is often even free to modify to suit any need – all we need is for that obstinate developer to simply tweak it to our application – what is their issue against using open source software anyway?
Continue reading

RSS Twitter LinkedIn Facebook Email

Networking Fundamentals Part 3 – The TCP Protocol

TCP ProtocolIf the IP protocol is considered the backbone of the Internet, TCP is heart and veins that bring it to life. As the primary protocol used by most of the Internet, from web browsing, to database access, to many multimedia applications, TCP lets computers talk to each other, and makes sure that the message gets through reliably.
Continue reading

RSS Twitter LinkedIn Facebook Email

Meta Languages vs Programming Languages

Meta LanguageProgramming is one of the few practices where, in addition to using tools to accomplish an end, individuals can also use tools to create more tools.  Through re-usable functions, libraries, and development frameworks, developers are able to simplify both present and future development, reducing unnecessary overhead and streamlining maintenance and updates.
Continue reading

RSS Twitter LinkedIn Facebook Email

Refactoring Complicated, Bad Code

RefactoringOne of the most difficult challenges in programming is fixing someone else’s bad code. This situation can often happen when taking over maintenance of existing software from a different company with inexperienced developers. While writing good code by itself is difficult enough, fixing previously written bad code requires first wading through the code in every execution scenario, and then writing replacement code that accomplishes the same results. Although this process often takes several times as long as initially writing a good version of the program, refactoring a key function or form can reap significant return on investment throughout the course of system support.
Continue reading

RSS Twitter LinkedIn Facebook Email