Feb 27, 2017

SSRS error - The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version. There is an error in XML document (1,xxxxx).

The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version. There is an error in XML document (1, NNNNN).

'#',hexadecimal value 0x1A is an invalid character. Line 1, position NNNNN.

This weird error appeared when trying to populate an SSRS parameter drop-down list with a list of names of organizations from a query.

In order to populate the drop-down list, SSRS runs the query to retrieve the list of values, then stores it temporarily as XML. The problem is, if there are any characters in the returned values which are invalid in the XML, then the report chokes, and throws this error.

To fix the problem, you need to figure out which record(s) that appear in the drop-down contain the unusual character and correct it.

The error includes the hex representation of the invalid character, so you can search for it in the database with some variation on this query...
SELECT TheID, TheString
FROM SomeTable
WHERE CONVERT(VARCHAR(MAX), CONVERT( VARBINARY(MAX),CONVERT(NVARCHAR(MAX),theString)),2) LIKE '%1A%'

I would have hoped that Microsoft would fix this issue by doing something to address the underlying cause, such as escaping the invalid characters when generating the XML, but they don't seem to have any interest. Even their own devs had to manually retype text to address the issue when it affected SCCM.

Dec 4, 2016

Today I flossed my keyboard

I used an old nylon knee-high stocking. Stretch it thin enough to insert between keys, then release one end and drag it through by the other.

May 13, 2015

Applying a wildcard SSL certificate to Unifi controller software

Running the Unifi controller software on a Ubuntu machine, and wanted to replace the self-signed certificate with my own wildcard cert. This was surprisingly easy, here are the steps I took...
  1. Download and install  Keystore Explorer from SourceForge on my Windows workstation. 
  2. Keystore Explorer insists on installing unlimited strength jurisdiction policy, but provides straightforward wizard to do this. Run Keystore Explorer as administrator, then follow the prompts to complete the update
  3. Once updated, launch Keystore Explorer and create a new empty keystore. Go to File - New and choose JKS for the type of keystore
  4. From Tools menu choose Import Key Pair - PKCS #12
  5. Click Browse, locate the PFX file for the wildcard certificate
  6. Provide decryption password and click Import
  7. When prompted for a password, enter aircontrolenterprise
  8. Go to File, Save As, and save the keystore file with the name keystore
  9. When prompted, enter the same password for the keystore, aircontrolenterprise
  10.  Using Putty PSFTP, upload the keystore file to a known location on the Unifi controller machine
  11. Oops, I forgot that I didn't have SSH running on the controller, so needed to install that on the Ubuntu machine... sudo apt-get install openssh-server
  12. Now on the Unifi controller machine, need to copy the new keystore file to the correct location. 
  13. Make a backup of the original keystore file just in case...
    sudo cp /var/lib/unifi/keystore /var/lib/unifi/keystore.bak 
  14. Copy the new keystore file I just uploaded to /var/lib/unifi...
    sudo cp ~/keystore /var/lib/unifi
  15. Restart the Unifi controller service, or just reboot the machine, and new certificate is now in place.

Dec 5, 2011

Vampire or Werewolf?

Vampire Names
Yves
Ramon
Jonathan
Samuel
William
Sigfried
Mikhail
Phillip
Natasha
Lily
Elizabeth
Sondra
Naomi
Maria

Werewolf Names
Lucas
Carlos
Roger
Jack
Jason
Henry
Trevor
Martin
Katherine
Lucy
Maura
Angela
Sadie
Belinda

Aug 7, 2011

FileMaker Database Naming Conventions

A concise, consistent and unambiguous naming convention is important for any database development project, or indeed any software development project. Filemaker is no different, but there are a few specific aspects to Filemaker development that require special consideration.
  1. Be specific. Avoid ambiguous or generic names at all costs. A total stranger should be able to read the names of your tables, fields, scripts, and layouts, and get a rough idea what they are for. Generic names should only be used for things that are truly generic, such as templates or loop counters, things that get reused in many different ways.
  2. Keep names short. This is especially important for naming tables and table occurrences in the relationship graph, and for names of layouts, because if your names are too long, the whole name may not be visible in the FM user interface, which can cause confusion and errors.
  3. If rules 1 and 2 conflict, go with rule 1.
  4. Avoid spaces. Filemaker will cheerfully allow you to use spaces in all sorts of places. At first, this may seem great, because it allows you to give things names that are very legible to humans. But there are many disadvantages to using spaces, especially when it comes to working with third-party platforms.
  5. Use Camel Case. Camel case is when you combine multiple words into a single name, and capitalize the first letter of each word. Like this: IAmGoingToTheStore. Even without spaces, it's easy to tell where words begin and end because of the case change.
  6. Use common or obvious abbreviations. Example: A field that holds the annual percentage rate can be called APR, but you wouldn't want to use PC to mean Postal Code, because it's not a widely known abbreviation.
  7. Use shorthand conventions to identify special pieces. Primary key field should always begin with the letters pk. Foreign keys should begin with fk.
  8. Use the underscore character at the start of field names that are calculated or otherwise derived from other data.

Don't state what something is in its name. If you have a table of names, don't call it "tblNames" or "NamesTable" or something, just call it "Names". Since it's a table, it will only show up in places where tables are relevant, and extra

Aug 6, 2011

A Handy Text Editing Tip

Here's a little tip that make editing code a bit easier. It's not guaranteed to work with all software, but it does work in a LOT of places.

Instead of pointing, clicking, and then dragging the mouse pointer to select a word of text, just point the mouse anywhere in the word, and double click it. On most popular platforms, doing this will instantly select the entire word. No need to pinpoint the exact spot where the word begins or ends, just double-click anywhere in it and you've got it selected.

Ok, you selected your word, now what? You want to replace it with another word? Just start typing. No need to delete first, because if you start typing when the word is selected, the entire selection will be replaced with whatever you type. If you want to replace the word with something in your clipboard, just hit PASTE after selecting the word. The paste operation will overwrite the selected text. No need to delete first, then paste.


What if you want to select the entire line? Try triple-clicking. In many cases, this will select an entire line, or even an entire paragraph.

This technique works when editing text in a word processor, editing cells in a spreadsheet, in a browser text box, and most other places where you can edit text. It even works when you're renaming a file in Windows Explorer or the Mac OS Finder.

Jun 21, 2011

Using server hits to measure web site popularity is like counting squashed bugs on your windshield to determine how far you have driven.