A couple weeks ago I bought a new helmet cam to use while skiing and biking. I haven’t made anything interesting yet, but I created a Vimeo account, and uploaded a couple videos to try it out:
I’ve never done any video editing, but Rob suggested Kdenlive, and so far it’s working out pretty well, but it’s taking a little time to figure everything out. The two clips I’ve posted so far didn’t really take much editing skill…
In any case, I’m working on some tree skiing footage that should be a little more interesting to watch, but it’ll probably be a few days before I get it good enough to upload.
I’ve been thinking this over for a while, and finally made up my mind to start my own company. I don’t think it’ll make me rich, but if I’m going to write software in my free time, I might as well make money from it if I can.
So far I’ve registered as an LLC, got the company blog up and running, and upgraded my Github account to get some “private” repos.
Next up I need to figure out what to do for the company website, and research online payment systems. I think I can just use PayPal, but I don’t really know what that entails. Should be interesting.
When I climbed Mt. Sherman first time I also climbed Mt. Sheridan and White Ridge. I wanted to get Gemini Peak, too, but didn’t get a chance.
Two years later, I finally got back around to it. It was weird trip in a way, because it was my first time up Gemini Peak, second time up Mt. Sheridan, and third time up Mt. Sherman. It was also the first time I hiked Mt. Sherman when it wasn’t snowy.
Other than that, it was a typical 14er/13er hike. I took a few pictures, but I don’t think they add much to the collection I took the last time I was up Sherman.
Here’s the GPS track.
I recently bought a book on computational geometry, and have been working my way through it, implementing some of the algorithms as I go. Eventually I’d like to implement all of the algorithms in the book, and get them working on made up sample data. For some of them, however, I’d like to implement more practical projects.
The first algorithm in the book is the convex hull. The convex hull algorithm takes a set of points and computes the smallest convex polygon that contains every point in the set.
I tried to think of where I could get some interesting “real life” point data and one thing that came to mind was the track points from GPS tracks. I’m not sure how useful it is, but the results are kinda neat.
The picture above is the result of running the code on some ski tracks from A Basin. The green polygon is the convex hull. The white lines are the ski tracks.
The code could use some polishing, but its mostly straightforward. It basically just reads the track points from a GPX file, calculates the convex hull, and spits out some KML that can be loaded into Google Earth.
The next chapter focuses on finding all of the intersections in a set of line segments and various applications of that. The algorithms are a bit more complicated, but I’m hoping to have it implemented in the next few days, and hopefully I’ll be posting something about it in the next few days.
I’m keeping all of the CG code in GitHub.
This is the second time I’ve meant to hike Mt. Powell, and the second time I’ve ended up hiking something else instead. This time I made a wrong turn and ended up on Pt. 12709, “Corner Peak”.
Here’s the GPS track
And here’s the route I should have taken, in green:
The mixup that led to the wrong turn is kinda funny. I lost track of the trail, so I started following this couple (the only 2 people I saw all day) ahead of me. I caught up to them before too long, and asked if they were on their way up Powell, just to double check. They told me I missed the turn off, and that we were headed up Peak C. I figured instead of backtracking, I might as well just climb Peak C instead, so I thanked them and kept going. It wasn’t until I looked at the summit register that I realized they were just as lost as I was. Oh well, Mt. Powell will be there next weekend…
Hiked my first 14ers in the Elk range this weekend with Castle and Conundrum Peaks. It was a really long day (14.8 miles and almost 5000 ft of elevation gain), but I had a great time. The Elks have amazing views.
The rest of the pictures are up on Flickr.
And here’s the GPS track.
I was planning to hike Mt. Powell up in the Gore Range this weekend, but once I got up there I had kind of a bad vibe about it, and I couldn’t find a camp site, so after driving all the way past Vail, I called it off and rushed over to Mt. Elbert. It’s not the most exciting hike, but I was pretty sure I’d get a campsite, and I hadn’t done a 14er in like 4 or 5 weeks.
It was pretty close finding a campsite. I think I got the last one in the entire area, but I DID get one, so it worked out.
The hike itself was a lot of fun. It was crowded, but could have been a lot worse. Since this was a repeat and it was crowded, I didn’t waste much time or take many pictures. Basically just some random summit pics, and this panorama:
The 9.35 mile round trip took 3:09, including 15 minutes to eat lunch and take pics at the summit. So far it’s my fastest time on a 14er, but I think I could do better if I had brought my running shoes and a smaller pack. Maybe next time…
In anycase, here’s the GPS track.
I realized the other day that I’ve only made one post in the “coding” category. I don’t spend as much of my free time writing code as I used to, but I figured I still do enough that it deserves more than one post. So here’s a quick write up about the latest mini-project I’ve been working on.
I’ve been implementing a (very) simple regular expression library in Python. It doesn’t really compare to the standard library’s ‘re’ module or to Perl’s regular expressions, but I’m mainly doing it to learn the underlying algorithms, and those are similar in the more powerful implementations.
To be honest, the project is mostly a rewrite of Haskell code I wrote and forgot about a few years back. I wanted to add new features, but I didn’t want to use Haskell, so I thought I’d rewrite the whole thing in Python. I got a little ahead of myself, though, and started adding new regex syntax before all of the old features were done. The table below (from the Github project Wiki) shows the supported regex syntax in both version:
|Zero or one
|Closure (zero or more)
|One or more
|POSIX named character classes
|Negative character classes
For most people, the only remotely interesting part of the project are probably the neat finite automata graphs it can produce using GraphViz:
The Wikipedia page for finite automata does a pretty good job explaining what the graph actually means.
There’s only one part of the Haskell code I still need to rewrite: the NFA to DFA conversion routine. I’m embarrassed to admit it, but I’ve been putting it off because my original Haskell code is so bad. I’m tempted to say it’s the worst code I’ve ever written:
-- Convert an Nfa to a Dfa using the algorithms from section 3.7.1 of the "Dragon book"
toDfa :: Nfa -> Dfa
toDfa nfa =
dstrt = e_closure nfa (n_start nfa)
init = Map.fromList [(dstrt, genStates dstrt)]
dfa = getps init
stateNames = genStateMap dfa
partial = Map.mapKeys (\x -> lookupDefault x 0 stateNames) dfa
dfaTrans = Map.map (\x -> Map.map (\y -> (lookupDefault y 0 stateNames)) x) partial
accepting = Set.fromList
(\k x ->
(Set.size (Set.intersection (n_accepting nfa) k)) > 0
Dfa dfaTrans (n_start nfa) accepting (n_rgx nfa)
getps old =
if (new == old)
else (getps new)
new = generateProductions old
generateProductions :: Map.Map (StateSet) (Map.Map NfaChar (StateSet))
-> Map.Map (StateSet) (Map.Map NfaChar (StateSet))
generateProductions fad = foldl
(\acc x ->
gt = (genStates x)
Map.insert x gt acc
) fad (getProductionStates fad)
genStateMap :: Map.Map (StateSet) (Map.Map NfaChar (StateSet))
-> Map.Map (StateSet) Int
genStateMap dfa = foldl
(\acc x ->
(y, sm) = mapState acc x
) Map.empty (Map.keys dfa)
getProductionStates fad = (concat
(\x -> Map.elems x)
mapState sm set = case Map.lookup set sm of
Just y -> (y, sm)
Nothing -> let ms = Map.size sm
in (ms, Map.insert set ms sm)
genStates set = Map.fromList (filter (\(x,y) -> not (Set.null y))
(\ch -> (ch, e_closure_set nfa (nfa_move nfa set ch)))
inSyms = Set.delete Epsilon (Set.fromList (Map.fold (\x acc -> acc ++ Map.keys x)  (n_transitions nfa)))
I’m actually a bit disappointed in myself for turning the compiler book’s 10 lines of psuedo-code into that mess. All I know is that when I finally get around to writing the Python version, it will be nothing like that.
The latest code is available at GitHub.
Skipped hiking and camping last weekend to avoid the 4th of July crowds. I heard I-70 was so bad they were “metering” traffic at the Eisenhower tunnel. Instead I did a bit of exploring around Westminster on my bike.
This weekend was back to the mountains, though.
Did a scramble along the east ridge of Pacific Peak, from the book Colorado Scrambles: Climbs Beyong the Beaten Path, and decided to grab “Atlantic” peak while I was there. To date, this is the most difficult scrambling route I’ve done.
Here’s a picture of the full ridge, from near Atlantic Peak. The route goes right along the top of the ridge.
And some of the terrain:
The rest of the photos are on Flickr.
Here’s the GPS track.
This weekend’s hiking trip was to 13933 ft. Mt. Hope and 13461 ft. Quail Mountain, near the town of Winfield. I was hoping to avoid crowds again, but there was a big training run for the Leadville 100 ultra-marathon going over Hope Pass, so that didn’t quite work out. Only saw two other people actually hiking Mt. Hope, though, and I had the summits to myself, which is the best part anyway.
The mountain views from the peaks in this area are some of the best in Colorado. The pictures don’t do them justice, but they’re on Flickr anyway.
This one of an old shack on Quail Mountain is my favorite of the bunch:
Here’s the GPS track.