Entity Framework Cheatsheet

This is my cheatsheet for using Microsoft's Entity Framework API.

(The existence of this page should not be taken as an endorsement of Entity Framework. It's not something you should learn more about if you don't have to. It's just another complicated ORM framework with its own quirks and annoyances.)

What Siri Is Good For

A recent study indicates that Apple's Siri doesn't perform very well when searching for information. I think most people who use Siri would agree, but "searching" is only one thing that Siri does.

I don't use Siri much for general question-asking. ("Siri, is it raining?") Instead, I use Siri as a quick way to perform operations on my phone. For example:

  • "Add eggs to my groceries list"
  • "Text my wife I'm on my way home."
  • "What is 345 times 843?"
  • "Set timer for five minutes."
  • "Set alarm for 6 AM"
  • "When I get home, remind me to take the trash out."
  • "Give me directions to Mall of Georgia."

Siri works almost perfectly for these types of requests. I can do all of these things without unlocking my phone, typing anything, or navigating through user interfaces, saving time and minimizing interruption of whatever I'm doing.

There was a period a few months ago when Siri was offline/unavailable a lot, but it is pretty reliable now.

Apple hasn't done a good job in educating people about Siri's capabilities. Anyone who tries to do what the celebrities do in the TV commercials will be disappointed. Instead, I'd recommend reading something like Talking to Siri: Learning the Language of Apple's Intelligent Assistant which can give you all the necessary instructions and tips.

Siri is far from perfect, but it is a really nice feature, and every other phone and computer maker is adding similar features. I'd recommend learning how to use the features effectively, rather than dismissing them due to their imperfections and limitations. Or you can just keep typing everything, like an old person.

HTML Man pages

If you've used UNIX-based systems, you're probably aware of man pages. And you know that they suck.

To make them a little less sucky, I wrote a little shell script called hman which displays a man page as HTML in the browser, rather than forcing you to use less. Here it is, if you'd like such a thing. (You'll need to install man2html via Homebrew).

So, with this, you can run hman bash and get something halfway usable.

Bash Scripting Cheatsheet

These are the half-dozen-or-so things I need to re-learn whenever I have to write a Bash script.

(And yes, I do know that the cool kids use zsh or fish instead of bash. You don't need to point that out to me.)

Good Online Resources

Snippets

My Setup

I'm a fan of The Setup, a website containing interviews with people about the tools they use to do their jobs. It is just "productivity porn", but I find it interesting.

As a tribute, here is my own "interview" for The Setup, using the standard four questions. I don't expect anyone to find this interesting, but writing it up helps me think about what I'm using and why, and it will come in handy the next time I have to set up a new computer.

20 Years Ago

It was 20 years ago this month that I graduated from college and got my first professional programming job. It has me reminiscing about what the computer programming profession was like before the Internet.

Want to Develop iOS Apps? Learn Objective-C.

As an iOS software developer, I am often asked whether "we" (a team I'm working with, or someone I'm advising) should avoid using Objective-C and instead use a higher-level or easier-to-learn programming language. In general, my answer is "No". The rest of this post explains why.

Sorting Entries in a PList by Key

My iOS applications use property list (plist) files to specify configuration parameters and other stuff. I was trying to do some comparison and merging of these plists, but was tripped up because the keys were in different order in different files.

So I whipped up a little Python script to sort the keys in the plists and write them in a canonical format. If you would be interested in such a thing, it's as easy as this:

Cold Science Fiction

I read a lot of science fiction (SF) in my adolescent and teenage years, but I got bored with it in college, and stopped reading it. Actually, I didn't get bored, I got annoyed with it. At the time, I couldn't describe exactly what it was that was annoying me, but I felt that each SF novel I read was following a formula that had stopped entertaining me, and that SF had become a waste of my time.

In the past few years, I've started reading SF again. I've read new stories by new authors, and tried to catch up on some of the SF classics I should have read back in the 80's. A friend loaned me his copy of Robert Heinlein's The Moon is a Harsh Mistress. I looked forward to reading it, as I had heard it was one of the best SF novels ever written.

I hated it. This novel reminded me of everything that made me stop reading science fiction.

Lots of smart people do enjoy this book, so I spent some time thinking about what they see in it, and what it is that I find so repulsive.

KJSimpleBinding

Mac OS X provides a pretty nice data-binding technology for developers, called Cocoa bindings. Unfortunately, the Cocoa bindings mechanism is not available to iOS developers, so iOS developers have to spend a lot of time writing code to keep user-interface elements and data in sync.

However, while Cocoa Bindings is not available on iOS, the underlying key-value coding (KVC) and key-value observing (KVO) mechanisms are, so it is straightforward to implement your own poor man's data-binding mechanism and eliminate some of the drudgery.

I have done just that. My KJSimpleBinding library is available on GitHub. I hope it is useful to someone, and I hope I have time to make it less simple.

I'm not the only one to try this. Here are a few similar projects I found on GitHub:

Syndicate content