Store Kindle Clippings in SQL Server with C# and Subsonic 3's SimpleRepository

Jul
31
2009

Back in April, Shelly mentioned having seen a 2nd generation Kindle and that she really wanted one. She happened to say so on a day when I was already admiring them. So, I ordered one.

I liked hers so much that I ordered one for myself shortly thereafter and it's gone with me nearly every day, everywhere. You can read any of several hundred online reviews of the device itself. Of course, most of those will either recommend or pan the device on its own, with no real consideration of how you read.

Lots of the stuff that I saw in reviews before I bought mine goes on a list of features I couldn't care less about. For instance, in the 4 months I've had mine, I've wanted to look up precisely 5 words in the dictionary and NONE of them was in there.

At any rate, I like it and my use probably isn't exactly what people think of when the Kindle gets mentioned. See, for me, the killer feature is the ability to highlight a sentence or paragraph or entire page and save it for later. Most of what I read on it is non-fiction: technical books and stuff like Curious? and Ratio.

In print books, I've always dog-eared pages and taken notes, but retrieving that information is always less than convenient. So, when I found out that the Kindle makes clipping text from books easy, I was excited. After clipping a couple of things, I went looking at the file format. All of the clippings get dumped into a single .txt file.

While that's fine for opening and looking through or even searching through directly on the Kindle, I wanted something that made it a little more organized. So, I wrote a quick proof of concept app to parse the file and put its contents into SQL Server and thought I'd share it with you.

I'd been wanting to do a little more with Subsonic 3.x's new feature SimpleRepository, which functions somewhat similar to db4o, but still SQL underneath. It strikes me as particularly suited to quick prototyping applications just like this one.

Rather than setting up the database schema, you just create your plain old C# objects (POCO) and SimpleRepository takes care of creating the tables as well as retrieving and storing your objects.

My POC app puts each clipping/quote into the database once and avoids duplication on subsequent runs. The result is much easier to, for instance, pull together everything from one book. The Kindle stores the clippings in the order they were clipped, making a mess if you don't read books linearly. Once written, I can easily keep my database up to date with anything I want to save from anything I'm reading on the device. Now that it's in that form, it could easily sit behind a web front end or be re-mixed in other interesting ways.

Anyway, on to the sample console app. I named it IpseDixit, which is Latin for "he himself said it".
Read the rest of this entry »

ORDER BY BiggestProblem DESC

Oct
21
2008

I caught a little snippet on NPR this weekend that fits in well with what I've been hearing a lot of on the radio, TV, newspapers and the like. They were interviewing someone who was making drastic changes to their life and spending due to a loss of one of the family incomes.

I had a lot of reactions that made me wonder how they afforded their previous lifestyle if the loss of a part-time job led to things like moving into the cellar to avoid heating the rest of the house. Lots of these stories on TV and radio and in magazines make me wonder how many of these are stories that happen every day, bad economy or not, but we now have crowds of journalists digging to find them because it makes for a good story now.

Digressions aside, one of their cost-cutting measures stuck out at me: dramatically altering what they wear to get down to only one load of laundry a week. What I heard sounded like there was a lot of effort for this and hit me funny because we got a new washer and dryer a couple of weeks ago and an image of those yellow EnergyGuide cards from both popped into my head.

The washing machine's card estimated that our ANNUAL energy cost for both electricity and gas (for our hot water) was . . . $11. That's right. Less than a buck a month to wash all of our clothes.

I'm not going to pretend that I understand their situation, but, if we needed to find an extra $1000 or even $2000 a month to scrape by in tough times, it's pretty clear that OUR laundry isn't a gold mine of wasted cash, just waiting to be tapped into.

Whenever I see huge effort going into places where it isn't going to pay off proportional to that effort, I start thinking in SQL. To me, given the amount of data I work with on a daily basis, it's entirely natural to take all of the expenses and ORDER BY the biggest expense when it's time to start cutting.

And, if a quick look at the top of that list doesn't reveal much, a quick ORDER BY "least important" works as well to reveal the easiest cuts.

This approach is something that's impressed me with how the Bill and Melinda Gates Foundation went about choosing the areas to attack first. Everything I've seen about that process says that they were pre-occupied with choosing problems that affect the lives of the highest number of people. They did an ORDER BY "number of people who die from ???" on the giant spreadsheet of problems in this world.

When I go out of my way to consider a problem or situation through this lens, I often end up with a much more obvious place to start my solution. I think this pattern is really powerful. Imagine going through your typical cubicle farm and following this simple process:

  1. Ask everyone the following questions:
    1. What is the most tedious computer-related task you do daily/weekly/monthly?
    2. How much time do you spend on it?
    3. If that task wasn't yours to do any more, what project that isn't being done now would you be able to do instead?
  2. Compile those results, along with salary-type information and start doing ORDER BY's to see what the most tedious, time-wasting tasks are actually costing.
  3. Start tackling the top of the list with a portion of your IT budget.
  4. Act on that list of projects that aren't being done by enabling people to get moving.

Imagine how many thousands of hours, tens of thousands of dollars are being wasted on things like manually comparing 2 reports, line by line for discrepancies because there isn't a reconciliation report that SHOWS the differences.

Imagine how many good ideas for projects, ideas for improving your business, for making a better product or offering a better service are stagnating in your cubicle farm. And, imagine that, after eliminating or reducing these tedious tasks, instead of laying people off, you reinvest that previously wasted time into those ideas and project.

I have to wonder how this little exercise might affect an organization's position in a tough market.

Setting Up Shop in the Shower

May
11
2008

A while back, there was a TV commercial (for a product/service I can't recall)1 that showed a group of businessmen having a meeting in a shower. They were there because the executive that called the meeting wanted to leverage the fact that his best ideas came to him in the shower.

That commercial hits us as relevant because nearly everyone has had the experience of being in the shower and having that thought, solution or idea completely come out of "nowhere" that is exactly what we want.

Of course, the commercial takes that experience and attempts to apply it in a way that obviously won't work. It's obvious to pretty much everyone. But, why?

It's because it's not about the shower. It's actually about the "slack" time and is key to innovative thinking. The beauty is that, while gathering your team into the shower won't foster this innovative thinking, it *is* possible to deliberately make these moments happen and is a topic I've been looking at quite a bit lately.

Lots of people develop their own ways to manufacture these moment. I like to think that I did a reasonable job at it myself. However, my recent interest in the junction of economics, neurology, psychology, self-improvement and my longstanding interest in cross disciplinary learning have been coming together to better understand and debug my own brain. Deeper understanding of how my own neurons are working can lead to better decisions and more effective practices.

On this particular topic, recent interest was sparked by an EconTalk episode with William Duggan. He was talking about his book: Strategic Intuition.

The conversation was very enlightening and I bought and subsequently read the book. While I've got lots I could say about the book (it really resonated with me), what's really worth taking away from it is the core idea of what exactly "strategic intuition" is.
Read the rest of this entry »

Toward 30 Days Straight at the Gym

Apr
10
2008

Ten years ago, I left college and sat down, completing a slowdown that began 4 or so years earlier. When I left high school, I transitioned from doing chores every day and working on the farm to going to college. I stayed relatively active, riding my bike to class year 'round and doing IT support on campus, which required walking all over.

However, when I graduated from college, my situation effectively purged all of the physical activity I was getting all along. Because I'd always just gotten my exercise doing things I already had to do, I didn't pay attention to the fact that The Great Sitting Down necessitated changing my eating or replacing the activity.

As many of you know, I did lose about 50 pounds a couple of years ago by addressing the diet and climbing the stairs at my project site. Alas, again, when 28 flights of stairs were no longer between me and my desk, that loss stopped and I've spent the last couple of years pretty much stuck in the same general ballpark.

While I've messed with a couple of things on the dietary front, I hadn't really done much to acknowledge the physical activity side of things.

Knowing this needed to change, a few months ago, I did like so many others and signed up for a gym, went twice and then kept paying the bill, but little else. Once I'd paid for 3 months and never set foot in the place, I decided that something needed to change.

Clearly, economics says that the best way to ensure that I actually do this thing that I consciously want to do is to leverage incentives or disincentives. I'd heard about a site where you could take out a contract on yourself where money would be sent to a charity you disagree with if you don't follow through (stickK.com). I gave it a look and even got about half way through signing up before abandoning that idea.

The big problem is that even though the goals are weekly, you have to give them the total cost of failure up front. So, you could say that failing to exercise this week would cost you $10, but if you wanted to commit to a year, you'd have to give them the whole $520 off your card up front.

While that is a perfectly valid way to do it, I shied away at that point.

When I sat back to consider the situation, I remembered a study that I had read about the amount of effort people will go to to avoid something so simple as doors closing on a computer screen. That mirrored what I've seen watching other people play video games. Even simple games where you have to keep things going can lead people to get REALLY concerned when nothing more than a few pixels are going to "fall" or break through a wall, etc.

That same principle is what is at work in Jerry Seinfeld's "don't break the chain" productivity method. Given the effects that just losing that incrementing number of completed days, I wondered what would happen for me if nothing more than that number WAS the thing I'd lose by not going to the gym.

So, revived something I've done for lots of other stuff with a 30 Day Challenge. I'd go to the gym every day for 30 days. Period. The challenge wouldn't be over until 30 days in a row were touched by a visit to the gym. Of course, the first few days are often easy and then, hopefully, the cumulative effect of the incrementing number would kick in.

I'm not bundling any sort of goal to lose weight. I'm not bundling any specific gym routine; stepping in the door counts. And, I'm now 12 days in. Twice, so far, I've had a "reason" to miss, but went out of my way to do it anyway, something I've never done with previous attempts at physical activity.

In other words, it's working.

Eye Catching Resumes

Mar
19
2008

I often push people who work as employees to view themselves as actually being self-employed. When you take a job, your little business just sold some of your time to a company for an agreed-upon amount of money per year. It's a business arrangement, so treating it like one makes sense.

When people make that shift, they often start to see their resume's more like potential "customers" of their services (employers) do. The resume and anything that accompany it are your marketing materials to land an interview. In that interview, you need to push the "deal" forward, but if your resume ends up in a stack with dozens or hundreds of others only to be tossed en masse, you don't even get that chance.

Sure, lots of places are pushing resumes into giant keyword databases. And, for that, you should make sure the text itself is optimized. However, there are still PLENTY of places where your carefully formatted resume gets viewed by a real person.

In those cases, having a resume that catches the eye makes a big difference in getting someone to actually read it and call you in for an interview.

If your resume is based on one of the 3-4 that come with Microsoft Word, consider something a little more unique. This great sample of really nice-looking resumes came through the feed reader this morning really shows what can be done to wake up a tired resume.

Some are more feasible than others if you aren't a graphic designer, but the ideas should certainly spark some changes in yours.

« Older Entries  

J Wynia

For better or worse, I'm the guy who runs things here. I'm a web consultant, software developer, writer and geek from Minneapolis, MN. This site is a fairly wide cross-section of the things I'm interested in and enjoy writing about. If you'd like a more "real-time" slice of my thoughts, you should follow me on Twitter here.

Oh, and if you happen to be looking for hosting for your Subversion repositories or just web hosting in general, take a look at Dreamhost. It's what I use for Subversion and your signup helps me out.

Feeds and Links


www.flickr.com
This is a Flickr badge showing public photos from J Wynia. Make your own badge here.

Search


Pages

Archives

Computers Blog Directory
© 2003-2010 J Wynia. All original content is licensed under the terms of the Creative Commons Attribution license unless otherwise noted. Content from other sources is licensed under its original terms.