Quick ‘n’ dirty blog to paperback

So you’ve got a blog with several years of posts and photos on it and you want to make a book out of it to preserve those memories but you don’t have time to design each page. You need an automated-ish solution. What to do?

Here’s what I did…

Step 1: Blogbooker.com

First I went to blogbooker.com. After playing around with their free plan to figure out what I wanted, I sprang for their $19 package and chose the following options:

  • PDF output
  • High (lossless) picture quality
  • 7.5″ x 9.25″ paper size (important!)

I did not include comments or a table of contents, as these severely blimped out the size of the book.

Here’s a view of blogbooker.com’s options… Continue reading

How to read maven-enforcer-plugin’s RequireUpperBoundDeps rule failure report

Scenario: To make use of a new feature in a certain dependency or to get a bugfix that’s causing your project pain, you bump the version of a dependency in your pom file — maybe the parent pom version. Then you type

mvn compile

…put your hands over your eyes, and gingerly press Enter.

And?

You may see something like this:

[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps failed with message:
Failed while enforcing RequireUpperBoundDeps. The error(s) are [
Require upper bound dependencies error for org.slf4j:slf4j-api:1.7.11 paths to dependency are:
+-com.example.blah:blah-service:2.0.1-SNAPSHOT
  +-org.slf4j:slf4j-api:1.7.11
and
+-com.example.blah:blah-service:2.0.1-SNAPSHOT
  +-com.netflix.hystrix:hystrix-core:1.5.4
    +-org.slf4j:slf4j-api:1.7.11 (managed) < -- org.slf4j:slf4j-api:1.7.10
and
+-com.example.blah:blah-service:2.0.1-SNAPSHOT
  +-com.example.framework:example-core:0.5.9-SNAPSHOT
    +-org.slf4j:slf4j-api:1.7.11 (managed) < -- org.slf4j:slf4j-api:1.7.7
and
+-com.example.blah:blah-service:2.0.1-SNAPSHOT
  +-com.example.framework:example-core-data:0.5.9-SNAPSHOT
    +-org.slf4j:slf4j-api:1.7.11 (managed) < -- org.slf4j:slf4j-api:1.7.5
...

…only it goes on for screens and screens. What happened? Continue reading

@@ROWCOUNT = 1 after empty MIN() query

Ran across a surprising SQL Server thing today: I was updating a query If you run a query that returns no rows and use the MIN() aggregate function, you get an empty resultset as expected, but the @@ROWCOUNT variable is set to 1. If you write the query as a TOP(1) query in a situation where it returns no rows though, you still get an empty resultset but @@ROWCOUNT is set to zero as expected.

Example of this in action (tested on SQL Server 2012):

CREATE TABLE MyTable(MyId INTEGER, MyName NVARCHAR(128));
SELECT MIN(MyId)
FROM MyTable
WHERE MyName LIKE 'MyTag'
IF @@ROWCOUNT <> 0 PRINT 'Nonzero row count'
ELSE PRINT 'Zero row count'
--Output: Nonzero row count
SELECT TOP(1) MyId
FROM MyTable
WHERE MyName LIKE 'MyTag'
ORDER BY MyId
IF @@ROWCOUNT <> 0 PRINT 'Nonzero row count'
ELSE PRINT 'Zero row count'
--Output: Zero row count
DROP TABLE MyTable;

How to have some roman numeral page numbers and some arabic page numbers in an existing document in LibreOffice

I needed to format an existing LibreOffice 4.3 document to have some beginning pages with no page numbers, then some pages numbered with roman numerals (i, ii, iii…), then the rest of the pages numbered with arabic numerals (1, 2, 3…). Here’s how you do it.

1. Create a page style that will do roman numeral page numbers in the footer

1.1. Go to Format -> Styles and Formatting (or press F11)…

libreoffice-multiple-footer-styles-1 Continue reading

SQL Server named instance vs. default instance

When you’re installing SQL Server (2008 R2 in my case) and you are prompted whether you want to create a default instance or a named instance, understand that creating a named instance means that you will be required to add that instance name to the server name when you connect via SQL Server Management Studio (SqlServerName\InstanceName). If you want to be able to connect to your instance without having to specify it explicitly, create a default instance. Then you just connect to SqlServerName and it finds the default instance.