Windows 10 and lein self-install fails on Powershell – Solved

I am starting to learn Clojure and wanted to set up Leiningen on my Windows 10 professional. Here is how I solved the Windows Security problem that was preventing me from downloading the github zip file needed. Here is hoping that someone finds this solution helpful. Using PowerShell running as Administrator, I was having trouble getting … Read more

Outlook Redemption (Redemption.dll) and Background Threading do not mix.

Outlook Redemption is a very nice library which allows access to many Outlook functions many of those not exposed via the Outlook object model. We are currently using Redemption in our application to add outlook appointments with reminders, pop email messages with pre-populated information, etc.

We wrapped the Redemption.dll into our own Singleton class and called it OutlookRedemption as you will see in the following code examples.

We have had a couple of situations where emailing from our application stops working or works intermittently and in both of those occurrences, the culprit was using the API in a back ground thread.

Read more

ClickOnce Deployment – Deploying multiple versions of the same application

According to Wikipedia, ClickOnce is a Microsoft technology that enables the user base to install and run a Windows Application by clicking a link in a web page. ClickOnce is a component of Microsoft .NET Framework 2.0 and later and it supports deploying applications made with Windows Forms or Windows Presentation Foundation.

ClickOnce attempts to bring the ease of deployment similar to web applications to the Windows user base. ClickOnce aims to solve three common problems with conventional methods of deploying an application:

  1. The sometimes difficulty of updating a deployed application.
  2. The impact of an application on a user’s computer system.
  3. The need for administrator permission in order to install or update the application.

WPF coding mutually exclusive Check Boxes with Data Binding

Last week I was coding a View that required for me to show two ChekBox controls which were mutually exclusive in the same way that two or more RadioButton controls that belong to the same group would interact.

My problem was that one Boolean property which came from a bit column in the database needed to drive which CheckBox would be checked: “Yes” or “No”.

In this example I attempt to show how to code two mutually exclusive checkboxes while binding to the Boolean property described above:

image

The Name of the Property in the Code Behind file that we are going to bind to is AddInsurance.

Here is the XAML code:

Read more

Creating a Singleton (Instance) Class in C#

In application development there are various situations in which it makes sense to code a class in a manner that it can be created (instantiated) once and used throughout the lifetime of the application. Generally this type of class is called a Singleton object.

When creating and object, CPU cycles are used up during the:

  • Creation of the Object
  • Initialization of the Object
  • Loading of the Object, including seed data from the dB etc.

Read more

Include Application Name in Connection Strings

In addition to the SQL Server, Database, User ID and Password, you may want to include the Application Name in your connection string parameters. Application Name is an optional argument, but it can greatly help you to segregate the SQL that your application is executing from any other database calls that are being sent from other applications/processes.

Data Source=myServer;
Initial Catalog=myDB;
User Id=myUsername;
Password=myPassword;
Application Name=myApp;

In example:

Read more

The Object-Oriented Thought Process …

Recently I came across a book which was a recommendation from a senior colleague at work. The Object-Oriented Thought Process by Matt Weisfeld. Although the first three chapters can seem a bit basic at first glance, they help to remind ourselves and reset in our minds what a true OO approach to a given problem should be.

Here is the Conclusion for (summary) Chapter 1 – Introduction to OO Concepts:

Read more