SignalR in Depth

by andyjmay May 10, 2012

I recently gave a talk on SignalR at the Tampa# group. Here are some resources for getting started with SignalR.

Nuget package - http://nuget.org/packages/SignalR

SignalR source and docs - https://github.com/SignalR/SignalR

Chat room for SignalR issues and questions - http://jabbr.net/#/rooms/signalr

Walkthrough demo for adding SignalR to a WebAPI site - https://github.com/andyjmay/TaskR-WebAPI

Same demo app, but fully SignalR and without the WebAPI - https://github.com/andyjmay/TaskR

Live demo - http://andyjmay.com/Apps/TaskR

 

 

I suggest learning how Hubs work first.

Server side: https://github.com/SignalR/SignalR/wiki/Hubs

JavaScript client: https://github.com/SignalR/SignalR/wiki/SignalR-JS-Client-Hubs

.NET Client: https://github.com/SignalR/SignalR/wiki/SignalR-Client-Hubs

 

Small update for CapsUnlock

by andyjmay January 29, 2012

I pushed a small update to CapsUnlock that addresses two annoyances:

 

Startup Time

Previously, CapsUnlock would check for updates before launching. This takes a few seconds and displays a small window stating that it is checking for updates. Since this application is rarely updated, this is a waste of time. I have changed it to look for updates every 7 days, and only after launch. This should greatly improve startup time.

 

Alt Tab

When minimized to the system tray, CapsUnlock would show up in the "Alt Tab list" of active windows. This was not necessary and has been removed. The trick I did to fix this behavior is very simple, but not obvious. You have to change the Form Border Style to be a ToolWindow. Tool windows do not appear in the Alt Tab list. But they also don't have a minimize button, so you have to reset the style when the window is shown again:

 

Resize += (s, e) => {
  if (WindowState == FormWindowState.Minimized) {
    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
  } else {
    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  }
};

Tags:

CapsUnlock Logging

by andyjmay December 11, 2011

There is some simple logging inside of CapsUnlock to help me debug any potential errors that might creep up. It logs some critical events that occur in the application to a text file in the installation path. This file is not sent anywhere, and no personal information is collected. Here is a sample log file:

12/11/2011 9:30:21 PM | Initialized PID cache
12/11/2011 9:30:21 PM | Clearing the PID cache
12/11/2011 9:30:21 PM | Cleared the PID cache
12/11/2011 9:30:21 PM | Starting CapsLockWatcher on cmd
12/11/2011 9:30:21 PM | Found process (filezilla) with PID: 7000
12/11/2011 9:30:21 PM | Added filezilla (7000) to PID cache
12/11/2011 9:30:26 PM | Found process (explorer) with PID: 2152
12/11/2011 9:30:26 PM | Added explorer (2152) to PID cache
12/11/2011 9:30:27 PM | Found process (capsunlock) with PID: 7732
12/11/2011 9:30:27 PM | Added capsunlock (7732) to PID cache
12/11/2011 9:30:33 PM | Found process (notepad++) with PID: 9184
12/11/2011 9:30:33 PM | Added notepad++ (9184) to PID cache
12/11/2011 9:30:53 PM | Found process (vcsexpress) with PID: 8240
12/11/2011 9:30:53 PM | Added vcsexpress (8240) to PID cache
12/11/2011 9:30:59 PM | Unable to find a process with PID: 0
12/11/2011 9:30:59 PM | Found process (thgw) with PID: 7100
12/11/2011 9:30:59 PM | Added thgw (7100) to PID cache
12/11/2011 9:32:15 PM | Found process (chrome) with PID: 7748
12/11/2011 9:32:15 PM | Cleared the PID cache
12/11/2011 9:32:15 PM | Added chrome (7748) to PID cache
12/11/2011 9:32:40 PM | Unable to find a process with PID: 0
12/11/2011 9:32:40 PM | Found process (thgw) with PID: 7100
12/11/2011 9:32:40 PM | Added thgw (7100) to PID cache
12/11/2011 9:33:26 PM | Unable to find a process with PID: 0
12/11/2011 9:39:16 PM | Unable to find a process with PID: 0
12/11/2011 9:39:16 PM | Found process (explorer) with PID: 2152
12/11/2011 9:39:16 PM | Cleared the PID cache
12/11/2011 9:39:16 PM | Added explorer (2152) to PID cache
12/11/2011 9:39:18 PM | Found process (chrome) with PID: 7748
12/11/2011 9:39:18 PM | Added chrome (7748) to PID cache
12/11/2011 9:39:19 PM | Unable to find a process with PID: 0
12/11/2011 9:39:19 PM | Found process (thgw) with PID: 7100
12/11/2011 9:39:19 PM | Added thgw (7100) to PID cache
12/11/2011 9:39:21 PM | Found process (paintdotnet) with PID: 6136
12/11/2011 9:39:21 PM | Added paintdotnet (6136) to PID cache
12/11/2011 9:39:27 PM | Unable to find a process with PID: 0
12/11/2011 9:48:20 PM | Unable to find a process with PID: 0
12/11/2011 9:48:20 PM | Found process (notepad++) with PID: 9184
12/11/2011 9:48:20 PM | Cleared the PID cache
12/11/2011 9:48:20 PM | Added notepad++ (9184) to PID cache
12/11/2011 9:48:24 PM | Found process (chrome) with PID: 7748
12/11/2011 9:48:24 PM | Added chrome (7748) to PID cache
12/11/2011 9:48:26 PM | Found process (explorer) with PID: 2152
12/11/2011 9:48:26 PM | Added explorer (2152) to PID cache
12/11/2011 9:48:27 PM | Found process (capsunlock) with PID: 7732
12/11/2011 9:48:27 PM | Added capsunlock (7732) to PID cache
12/11/2011 9:48:28 PM | Stopping CapsLockWatcher
12/11/2011 9:48:28 PM | Closing...

Opening the log file is a hidden feature (on purpose, this should only be necessary in debugging). If you hit CTRL + L it will open the log file in a text editor. If you ever encounter any bugs/crashes please save a copy of your log file and upload it to a new Bitbucket Issue.

CapsUnlock Updating

by andyjmay December 11, 2011

CapsUnlock is a Microsoft ClickOnce application. This means that it will automatically prompt you to update, when one is available:

This will allow you to always run the latest version, and not worry about checking to see if there is an update. Admittedly, there probably won't be a lot of updates to CapsUnlock. It's such a simple tool and I don't have any grand plans for it. But I wanted to show what it looks like if there is an available update, so you aren't alarmed if it pops up.

Introducing... CapsUnlock

by andyjmay December 11, 2011

At my work, most people use AutoCAD all day. When they are in CAD, most of the time they have Caps Lock on. But then they have to write and email, and halfway through they realize that THEY ARE SCREAMING. Then they turn off Caps Lock, finish their email, switch back to CAD, and forget to turn Caps Lock back on. 

So when I was asked if there was an application that would handle their Caps Lock issue, I said "I don't know, but that should be pretty easy to make". It turned out not to be as simple as I thought it would be, but after a weekend of work I've now got a working application. It probably won't eat your children, but let me know if you encounter any crashes or bugs.

I will be releasing the source code very shortly, but you can install it now from this page.

Month List

Page List

Tag cloud