Here’s a little PostgreSQL puzzle.
Why does the following result in
ERROR: failed to find conversion function
from unknown to text on PostgreSQL 9.3?
But this works perfectly fine?
The only difference is the subquery.
In the first snippet, PostgreSQL complains that the type of column
unknown. I find this strange, considering that the query uses
a string literal and it is obviously
In the second snippet, the string literal has been replaced with a
the problem goes away. It’s fascinating that PostgreSQL is able to correctly
determine the type of a computed column, in this case, but not the type of a
column defined with a string literal.
CAST to the
x column resolves the issue.
Using Git on a daily basis, and rebasing commit history nearly as much,
led me to ask the question: Why doesn’t
git --amend work with arbitrary
For example, imagine being able to stage some changes, and then squash them
git-amend HEAD~1 or
I imagined that this ability wouldn’t be much different from a fixup commit that was immediately squashed into the target commit. With that in mind, I created a shell script to do just this.
The biggest drawback is that you can’t stage more than 1 fixup at a time
since it rebases history. However, I would argue that similar to
git --amend, this utility is designed for a narrow use-case and
shouldn’t be expected to handle anything more complicated.
What I learned is that rebasing is complicated. There’s a reason that
git --amend doesn’t work like this out of the box, and the reason is probably
that this command is only marginally useful for minor changes, and
useless for non-trivial fixups.
While this command was not as useful as I expected it to be, I still use it at least once or twice per week, and plan to continue experimenting with it and hopefully come up with some better ideas on how to improve its usefulness.
For those interested in obtaining access to private repository information using the Github API, here is a sample application built with Flask, which demonstrates how to perform authorization via OAuth.
The bulk of the work takes place in
I’ve been using the Workman keyboard layout for about 4 weeks now, and other than Ubuntu randomly changing keyboard layouts, it’s been a positive experience.
As my touch typing speed increased, I was surprised to find that my fingers would occasionally revert to Dvorak, which I have not typed for years. Although I think that Dvorak is a great layout, I don’t find it particularly attuned to programming and general keyboard shortcuts compared to the Workman layout. Try to copy & paste on a Dvorak keyboard and you’ll see what I mean.
I enjoy using the Workman layout and I plan to keep using it indefinitely.
My typing speed is presently around 40-50 WPM.