Skip to content

jkshay.com

Technical tidbits that fell out of my head…

Contact

  • Home
  • Programming Tips
  • Technical Tips
  • Wordpress Tips
  • I find this fascinating
  • About Me
  • The WWW turns 25

    December 21, 2015

    +

    +

    +

    +

    +

    +

    As I’m making the transition from a desktop application developer to that of web
    application developer, I’m discovering many fascinating web-related bits of trivia. For example, I discovered this morning that the world’s first web page went online 25 years ago yesterday.

    To put that in perspective, many of my co-workers aren’t yet 25.

    Here is a short article regarding the publication of the first page on Tim Berners-Lee’s first web page.

    +

    +

    +

    +

    +

    +

    + I find this fascinating
    + WWW

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

  • A hundred! (Actually, 70,000!)

    August 12, 2015

    +

    +

    +

    +

    +

    +

    Just a quick post to celebrate my 70,000th page view on my site!

    I know I’ve been inactive for a while (it’s been a really busy year, what with downsizing, moving into the tiny house, warming up to the new job, buying a farm, getting ready to move again…) but I promise to have more articles coming soon.

    So if you want to drop by and see what hasn’t been going on, I’d certainly appreciate it!

    +

    +

    +

    +

    +

    +

    + Uncategorized

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

  • Configuring a cloud-based secure multi-domain web and e-mail server

    October 13, 2014

    +

    +

    +

    +

    +

    +

    Introduction

    As I’ve mentioned previously, I own an HP MediaSmart server. Up until recently I’ve used it to host both my jkshay.com domain as well as my wife’s thebumbleshack.com domain. If you’ve seen thebumbleshack.com, you’ll see that we’re currently in the process of downsizing, reducing our possessions and living a simpler, more harmonious lifestyle. That being said, I knew I was likely taking my server off-line (it’s a HUGE power hog) and needed a replacement solution.

    We’ve used cloud servers at my current employer for several years, hosting several sites with e-mail and web services without issue. I just didn’t want to pay the high prices (upwards of $100/mo minimum) to replace something I *could* do for the cost of electricity, so I set out to find an affordable alternative – and I did. (more…)

    +

    +

    +

    +

    +

    +

    + Technical Tips, Uncategorized

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

  • Creating (and restarting) a single-instance WPF application with SingleInstance.cs

    July 27, 2014

    +

    +

    +

    +

    +

    +

    My current project presented a unique challenge. I have a need to:

    1. allow only one instance of the application to run at each workstation,
    2. notify the user that an instance is already running if a second instance is started, and
    3. be able to programmatically restart the application.

    Thankfully, Microsoft has provided the SingleInstance.cs to serve these needs. Following this article on CodeProject.com was a great start. The author Arik Poznanski did an excellent job explaining the steps necessary to implement the first two requirements. I combined his techniques with information found in this article on StackOverflow.com to fully satisfy all three requirements – an application that will only allow one instance, that will notify the user that an instance is already running, and that can easily be restarted programmatically. (more…)

    +

    +

    +

    +

    +

    +

    + Programming Tips, Uncategorized
    + .NET, C#, Single-Instance application

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

  • Implement WebClient’s asynchronous download with cancellation capability

    May 15, 2014

    +

    +

    +

    +

    +

    +

    When I wrote my article regarding use of the BackgroundWorker to keep the UI responsive, I used the WebClient’s DownloadString method as an example of a long-running process. I used this as an example in explaining how to use the BackgroundWorker, which simply allows for thread-blocking code to be run in a separate thread.

    As it turns out, this is a terrible idea. Not the whole thread-blocking code in a separate thread, but the use of a WebClient in a BackgroundWorker. You see, the WebClient class implements a DownloadStringAsync() method. This allows the calling code to continue to run, and the asynchronous process will eventually return a string. But since it’s asynchronous, our UI thread will never get blocked by a long-running process. And since it too supports asynchronous cancellation, there’s no reason to embed it inside a BackgroundWorker. (more…)

    +

    +

    +

    +

    +

    +

    + Programming Tips, Technical Tips, Uncategorized
    + asynchronous, BackgroundWorker, MVVM, WebClient

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

  • Implement cancellation ability on BackgroundWorker

    May 14, 2014

    +

    +

    +

    +

    +

    +

    As I mentioned in my article on implementing the BackgroundWorker to keep your WPF user interface responsive, the BackgroundWorker class supports cancellation. I will illustrate here how easy it is to accomplish.

    I’ll build this example by continuing the example in the previous article. First, let’s add a BackgroundWorker property to our DataModel class. (more…)

    +

    +

    +

    +

    +

    +

    + Programming Tips, Technical Tips, Uncategorized
    + BackgroundWorker, C#, Cancellation, MVVM, WPF

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

  • Easily create a WPF splash screen with status updates via MVVM

    May 9, 2014

    +

    +

    +

    +

    +

    +

    I was in search of an easy implementation of a splash screen for my current project. I wanted to be able to show a splash screen and update it with current status information as my application initialized.

    The standard SplashScreen class provided by Microsoft does not support showing dynamic content on the SplashScreen. For this reason, I was not able to use the supplied class. Instead I decided to create my own.

    The splash screen I created is simply a regular window bound to a view model. I’ve created a SplashScreenHelper static class that we’ll use to send status updates to the splash screen. (more…)

    +

    +

    +

    +

    +

    +

    + Programming Tips, Technical Tips, Uncategorized
    + Delegate, Dispatcher, Invoke, MVVM, Splash Screen, WPF

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

  • Embedding an Axis brand camera into WordPress

    April 12, 2014

    +

    +

    +

    +

    +

    +

    [showAxisCamera url=”208.42.203.54″ port=”8588″]
    After I posted my article about embedding a video feed into my WordPress site, I received an e-mail from a reader in the UK looking for assistance configuring an Axis brand camera in a WordPress site. Ultimately, I ended up creating a more robust version of my original code, but for Axis brand cameras. I thought I would share that code here, with a brief explanation of the changes from the original article and a few examples of implementation.

    I’m not claiming authorship of this code; rather, I just tweaked existing code the reader provided to get it working in WordPress (including the creation of a short code).

    In this code, I implement the ability to use a single shortcode with multiple cameras at different subdomains. I won’t go into how to add this code to your WordPress site (I explain how to do this in the original article). Just know that it should be added to your theme’s functions.php file. (more…)

    +

    +

    +

    +

    +

    +

    + Technical Tips, Uncategorized, Wordpress Tips

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

  • Purge DataContext ChangeSet without reinstantiating

    January 16, 2014

    +

    +

    +

    +

    +

    +

    I’m currently working with Linq-to-SQL, and have used attribute mapping to map my classes to database tables. In doing so, I’ve created a Database context that derives from DataContext (and takes my encrypted connection string stored in settings as a default parameter). To create a database connection, I simply use typical code as illustrated below.

    Note that the following terms are referred to below, but not included for brevity:

    • ViewModelBase – provides INotifyPropertyChanged implementation
    • Customer – a typical class representing a Customer object

    (more…)

    +

    +

    +

    +

    +

    +

    + Programming Tips
    + C#, ChangeSet, Linq-to-SQL

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

  • Creating a flexible custom WPF dialog

    October 14, 2013

    +

    +

    +

    +

    +

    +

    In my current project, we had a need to create a custom WPF dialog box. Writing our own provides us the ability to easily skin the window with our application’s theme as well as gives us the ability to generate any buttons we wanted.

    We wanted our custom dialog box to be able to:

    1. Display a message to the user
    2. Provide various button options (OK, OK/Cancel, Yes/No, Yes/No/Cancel, etc)
    3. Return the button clicked by the user
    4. Display an optional CheckBox
      • Display text next to the optional CheckBox
      • Accept a boolean property for the default IsChecked state of the optional CheckBox
      • Provide the IsChecked value of the optional CheckBox as an out parameter

    (more…)

    +

    +

    +

    +

    +

    +

    + Programming Tips, Technical Tips
    + Constructor Chaining, Custom Dialog, MVVM, WPF

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

    +

1 2 3
Next

Copyright 2026

Loading Comments...