Weekly Twitter Dump in C# Using TweetSharp and NVelocity

Dec
23
2009

Last week, I posted a selection of postings that I made on Twitter. Because I tend to find more "Twitter-sized" chunks of time than "blog post-sized" bits, it provides a way of sort of taking notes in public.

That fits in well with how I've long handled even longer-form blogging. I gather flotsam and jetsam from my own thoughts as well as my input streams, sort and ruminate on it and share the result.

However, when your notes are scattered across notebooks, Kindle clippings, Twitter postings, Delicious bookmarks, saved RSS items from Google Reader, etc, gathering that all together in one place to digest and transform becomes a challenge.

To that end, I've been slowly building up prototype code to gather each of those sources. A few months ago, I took care of gathering up my eBook notes via the Kindle. Today, I used TweetSharp to grab both my own Twitter postings as well as those that I marked as "favorites". So, I'm sharing that prototype with you.

Read the rest of this entry »

Moving a Project From Subversion to Git

Apr
07
2009

I’ve been interested in the stuff that I’ve heard about git since hearing that Linus Torvalds was ditching BitKeeper and writing his own replacement to handle version control for the Linux kernel. I’ve taken a look at it a few different times as it’s profile grew in the Rails/Perl/etc communities.

Every time, there was something that kept me from adopting it: the state of Windows support. And, after this past week, I think that my focus on the msysGit version was part of the problem. I have been reluctant to use the Cygwin version. That is mostly because I didn’t want to *have* to install all of cygwin on any workstation where I want git support and the pile of files that adds.

The thing is, though, that when I took a good look last week, I already had cygwin running on every single Windows machine I’ve got, INCLUDING virtual machines. Never one to cling to a supposition after evidence invalidates it, I gave git on cygwin a shot.

Because I still have lots of Subversion repositories and am likely to continue using it on lots of projects, I insisted on getting the git/Subversion integration working. Also, I use a Dreamhost account to host my repositories and any project-related forums, project tracking, etc., as a sort of private Sourceforge/Codeplex/Google Code without any licensing issues to deal with. I wanted to add git support to that existing project space.

It turned out like most projects of this sort. The stuff I thought would be a pain (like getting git running on the Dreamhost account) turned out to be documented and straightforward, while stuff like getting the “git svn” command to work (which should just work off the cygwin install) thwarted me for far too long.

Set up your own private project server with git, Subversion, etc. at Dreamhost and use the code GLASSTOOBIG to skip the setup fee.

However, after I worked out the kinks, I was able to get it working and pointed at some of my Subversion repositories on several of my workstations. After cloning those repositories, what I'm most suprised by (even though I was told to expect it) is how git manages to copy ALL of the version history for the entire repository into a single .git directory (instead of hundreds or thousands of .svn directories) and end up with something SMALLER than the single version checkout of Subversion for the same source tree.

As an example, one of my repositories had 440 revisions across 10 branches. A checked out copy from Subversion of the current release branch is 2.51GB in 43,655 files across 23,361 folders.

After moving it to git, the checked out copy, which now includes the ENTIRE 440 revision archive of project history is 1.51GB in 15,356 files and 2,233 folders.

As far as the hiccups, it boiled down to a couple of things:

  1. Make sure to install all of the “git” related packages in cygwin.
  2. Install the subversion libraries for perl (they’re not anywhere near the “git” packages in the cygwin installer). This took care of it complaining about the SVN CPAN Perl library.
  3. Be prepared to have to run “rebaseall” on the cygwin installation.  This took care of a LOT of cygwin complaints about various DLL’s.
  4. Running “git svn clone http://example.com/repos/” can be agonizingly slow on large repositories. It’s not an issue if you’re working off of a tiny project, but that 1.5GB project took all night and then some. Ongoing work is quite fast, so I’m hoping they work the kinks out of this going forward or that they’ll ditch the tagline “The fast version control system”.

Given how efficient it is with storage, I’m interested in experimenting with running it in the background on my development directories and having a FileSystemWatcher commit whenever things change. I’d like to see how long it takes before things get out of control.

I’m also hoping that the GUI tools catch up. That’s not so much because I want them for myself (I prefer commandline for SVN as well), but because TortoiseSVN has been key in getting SVN adopted on projects and flushing SourceSafe on several of my projects.

ASP.NET MVC Plugins

Dec
05
2008

One of the last things I posted here was how I was toying with flexible content and template solutions in ASP.NET MVC. For that project, we're going forward with the solution that emerged from that experimentation and I'm excited to see how it turns out. 

Along the way, an interesting question about how to create what are essentially plugins for the MVC framework. Basically, if what you're building is an MVC app that will be deployed in dozens, hundreds or thousands of independent implementations, it becomes obvious pretty quickly that you need most of the pieces of the application to be modular so they can added/removed/overridden at least to a minimal level.

I've come up with what I think is a workable solution, which is pretty much just gathering up some of the other ideas already out there into a quick-n-dirty working prototype. The basic idea is this:

Put an encapsulated set of model classes (or none if you depend on central model classes), controller classes and a set of views into its own DLL. The views (using the default WebForms view engine, they're aspx files) go in as resources.

Pull that DLL into your MVC application and the MVC stack inside your "plugin" will work just like if those bits had been a "natural" part of the base MVC application. In fact actually creating the pieces from inside the main app and then moving them over to their own project is the quickest way I found to actually create the bits for the plugins.

When the question came up, I vaguely remembered seeing a question on StackOverflow about how to put views into an assembly/DLL. That question along with one on VirtualPathProviders provided most of the kernel of what I needed.

So, on to how to actually do this.
Read the rest of this entry »

Dynamic Font Replacement: sIFR, FLIR and More

Aug
22
2008
numeral types
Creative Commons License photo credit: threedots

A couple of weeks ago, Antonio Lupetti shared a list of 10 "handwritten" fonts that he uses in his design projects. He also does a brilliant job of integrating that stuff into the diagrams in his posts, which is why I paid attention when he put out a list (just take a look at his archives and you'll see what I mean).

As I was looking at those fonts and downloading them, I was thinking about sIFR, which I've mentioned before. It's a way to replace text in web pages with Flash on the fly, using fonts that aren't on a user's computer. I've wanted to include that on this site and on several others for quite a while.
Read the rest of this entry »

Writing My Own Travel Agent in C#

Jul
30
2008

Yesterday, Garrick was describing the difference between a "search result" and "find". His short answer was:

Search Results Listings say, 'The answer might be here'. Find says, 'Here you are, get on with your day.'”

That distinction is something that has always struck me as irritating about using every travel site I've ever seen (later discussion revealed that, ironically, this distinction is talked about obsessively at Orbitz). That irritation is because every search I've made started out as something that doesn't fit in their search boxes: "Find me a cheap coach flight and a hotel near the conference center in Austin, TX for SXSW", "I'd like to go to San Francisco for a long weekend some time this fall; is there a way to do that for under $500?" or "Which one of these cities and which weekend will be cheapest in October for a 5 day weekend?".

Those aren't questions which naturally get answered by a search results page. You don't get to pose those questions to travel sites. What you are asked on every one of them is to choose specific dates and, in many cases, both airports. The sites don't even so much as hold on to the fact that 99% of my travel is based out of Minneapolis/St. Paul International Airport.

Rather, I get a constant flow of emails from the travel engines telling me about great deals to Miami/Las Vegas/New York for $89. Of course, if you are flying out of Minneapolis, that deal suddenly becomes $327 instead.

There is a place you could and can ask those questions and get your "find" satisfied. Travel agents pick up the phone, listen to just such a question and call you back later in the day with the results of your find. Unfortunately, they also are professionals who need to make a living. That means they're not entirely thrilled to, for instance, check daily for weeks at a time for a very specific set of criteria for a vacation I may take if the deal is good enough.

That does, however, smell of the kind of thing that I like sling a bit of code to solve. And, it's something I've wanted to solve for a very long time. Every couple of months, I go looking for a way to write code that searches for flights and hotels and have always come up empty.

Then, this weekend, I did it again and ran across the Kayak API, which looks like what I've been looking for all along. The API allows 1000 searches per day, per developer key. While that wouldn't let me create much of a public service or commercial application, it's a really roomy number if you're looking to do lots of permutations for your own travel needs.

Personally, I'd like to do things like have a list of cities I've never been to and have software grind away on it, finding a good deal for a "fall long weekend" or a "week-long summer vacation", etc. for one of those locations. Similarly, I'd like to be able to say, "I've got $300. Is there somewhere I can go and get a hotel for a 3 day weekend that's on my list?".

Software can easily handle digging through the tedious crap like seeing whether leaving on Thursday and coming back on Sunday is cheaper or more expensive than leaving on Friday and coming back on Monday. As a person, trying those combinations on the existing search results-oriented sites is tedious. Tedious is what software does best.

Before I start dreaming too big for what might be possible, I threw together a quick POC app to see how easy it might be to search and grab results. I created a really basic class library for doing the actual searches and a tiny console app to try out a single search.

I have to say, I like what I see and think that there are some real possibilities for coding up my own travel agent with Kayak.

The sample, half-finished POC code is available in PDF form if you want to look at it. It's got gaping holes all over (hard-coded, read-only properties, unused properties, concatenated strings, etc), but shows the basic idea for how to hit the service. This doesn't do anything to take advantage of any of the polling cycle that the API documentation describes, so the results are incomplete.

However, it proved what I wanted from the POC. I'm now pretty sure that I'll be able to get what I want out of that API. If you're interested in travel and writing software, it might be worth a look for you as well.

« 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.