I blogged about it over on the byCycle blog.
Wildwood Trail from Germantown Road to Newberry Road
Date: July 17, 2012
Elevation: N/A
Distance: 11
Time to top: 1 hour 30 minutes
Time back: 1 hour 20 minutes
Weather: Partly cloudy, not too hot
Gear: Running shoes, small Camelbak pack with 3 liters of water
This was a nice, rolling hike through the northern part of Forest Park. This section is all forested except for two (?) clearings that take about thirty seconds to traverse. There’s no significant elevation change to speak of, though there are a couple of moderately steep sections.
Angel’s Rest
Date: July 15, 2012
Elevation: ~1500 feet
Distance: 4.4 miles (+2)
Time to top: 45 minutes
Weather: Overcast mostly, intermittent light rain on the way up, fog at top, a bit of sun on the way down
Gear: New hiking boots, medium pack, 2 quarts of water, rain jacket
There was steady rain on the drive out, which was good because that meant there’d probably be less people on the trail. There were still quite a few people out, though–this is probably not a good place to go on a sunny weekend.
I initially missed the Rest because of fog–I couldn’t see the view–and walked an additional couple miles beyond it before I realized I went too far. I found a nice patch of huckleberries, though, so it was worth it (especially because I didn’t bring any food!). First I went down the trail toward Multnomah Falls, then I turned back and went up another trail toward Devil’s Rest.
Once I finally got to the Rest, I hung out for an hour or so and watched the fog. At some points, it was a little creepy–I was by myself and the fog seemed alive. Now and then the Columbia river and WA were visible.
Most of the time, it looked like this:
But I did get one good shot from the top:
Street Ramble: Triple Crown
The Triple Crown street ramble traverses Council Crest, Hoyt Arboretum, and Pittock Mansion in West Portland. It covers nine miles in three hours. The route is roughly equal parts urban areas, neighborhoods, and parks/trails.
One of the ramblers recorded our track using MapMyWalk:
Saddle Mountain
Date: July 11, 2012
Elevation: 3283 feet
Distance: 5.4 miles
Time to top: 50 minutes
Weather: Hot (~90 degrees), sunny, hazy
Gear: Trail running shoes, small Camelbak pack
The trail is very steep pretty much the whole way; it’s shaded for about the first half and then open and rocky to the top. It was really hot, and I got a bit sunburned. The view from the top would probably be pretty spectacular on a non-hazy day.
There’s a nice, shady spot to hang out at the end of this other trail (top left of image below), which is just a little lower than the peak. I hung out there for about an hour.
What I Learned from the apache.org Break-in
Here’s my initial take-away after reading about the recent apache.org XSS-initiated break-in:
- If you’re going to allow caching of credentials (Subversion or otherwise) on a server, don’t use an account that shares credentials with any superuser account. Personally, I can’t think of a good reason for these credentials to be cached in the first place (except on a development machine). As an aside, by default, Mercurial doesn’t do this; I suppose the fact that every ‘svn commit’ is also a push makes this more “necessary” with Subversion.
- If you have an organization-wide login (say a Windows login that is automatically sync’ed with Subversion, your enterprise RDBMS, and who knows what else[1]), if at all possible use a different password on any server where you’ve got superuser access.
- All superuser accounts on servers should have different passwords; at a minimum, if you use a common password for superuser accounts across servers, don’t use this password for other accounts.
- Use Trac instead of Jira. [2]
That’s a bare minimum; I’m still thinking about how vulnerable the organization I work for might be. Most of this probably seems obvious, but I’m betting that these and other less-than-best practices are extremely common.
–
Ref: https://blogs.apache.org/infra/entry/apache_org_04_09_2010
[1] This is a purely hypothetical scenario.
[2] Just kidding?
Eclipse for Python Web Development on Ubuntu
Updated 14 July 2009 for Eclipse 3.5. Now using Aptana to install PyDev.
Updated 5 March 2010 for Eclipse 3.5.2 and Subversion 1.6.
Updated 20 July 2010 for Eclipse 3.6
Updated 1 August 2011 for Eclipse 3.7 and Aptana Studio 3
Overview
So, I think I’ve finally decided that I prefer Eclipse for Python Web development over NetBeans. (I prefer Wing IDE over both for straight Python development, but that’s another post.) Eclipse’s Python support, via PyDev, seems more advanced and NetBeans has some annoying issues. Eclipse also seems a bit snappier, at least on my machine (YMMV, blah blah).
Eclipse takes a bit more effort to set up, but once you’ve done it a couple times, it’s pretty straightforward. The hard part is keeping track of the links to the Eclipse update sites and remembering a few odd bits of configuration. This document gives details on installing Eclipse for Python Web development with Aptana, PyDev, and Subclipse.
The instructions here are Linux/Ubuntu-centric, but the instructions for getting to the Platform Binary–the smallest possible Eclipse download, as far as I can tell–are applicable to all platforms.
Download Eclipse
If you go to the Eclipse downloads page, you’ll see packages for Java and C++ along with some other options. If you’re doing ONLY Python development, you might wonder which version to download. These versions install cruft I don’t want or need. I finally found what I think is the smallest possible Eclipse package, the so-called Platform Runtime Library.
- Start here: eclipse project downloads.
- Find the Latest Release under Build Type in the Latest Downloads section and click the 3.7 link under Build Name.
- Click Platform Runtime Binary in the left hand menu.
- Choose for your OS by clicking one of the (http) links in the Download column; I chose Linux (x86/GTK 2) for 32 bit Linux. Here’s the 64 bit version: Linux (x86_64/GTK 2).
- You still need to pick a mirror! I use the OSU Open Source Lab link because it’s close to me and fast.
- And finally, the download begins…
Install Eclipse
Extract the downloaded package: tar xvzf eclipse-platform-3.7-linux-gtk.tar.gz. I rename the resulting eclipse directory to eclipse-3.6, move it to ~/.local, and create a symlink in ~/.local/bin to the eclipse executable: ln -s ~/.local/eclipse-3.7/eclipse ~/.local/bin/eclipse
Configure Eclipse
Edit ~/.local/eclipse-3.7/eclipse.ini. Find the line containing “-vmargs”. Add a new line directly below that: -Djava.library.path=/usr/lib/jni. Save and close. Fire up Eclipse.
Install Aptana Studio
- Help > Install New Software… > Add
- Eclipse update URL: http://download.aptana.com/studio3/plugin/install
- Click OK, click the Aptana Studio checkbox, click Next, click Finish, wait…, click Yes to restart Eclipse
Install PyDev
PyDev is installed as part of the Apatana Studio install.
Install MercurialEclipse
Eclipse update URL: http://cbes.javaforge.com/update
Supervisor now supports Python 2.6
I’ve been using Supervisor for a few months now to manage some app servers at work. Good stuff; solid. My only gripe with it was that it didn’t run properly under Python 2.6[1,2]. I had to install Python 2.5 just to run Supervisor, which isn’t a super big deal but is kind of annoying. The latest release, 3.0a7, fixes this by including a “patched version of Medusa to allow Supervisor to run on Python 2.6.”
Note: I had to `wget http://dist.supervisord.org/supervisor-3.0a7.tar.gz` and easy_install that due to a network timeout[3]. I assume that’s because Supervisor is super popular and everyone’s upgrading.
[1] It did run under 2.6 but issued an error when starting up.
[2] This was due to changes in the Python 2.6 stdlib, not a problem with Supervisor itself.
[3] Suggestion: If possible, remove link from PyPI to http://supervisord.org/ so easy_install doesn’t get stuck there.
Implementation of Dijkstra’s Single-Source Shortest-Paths in JavaScript
I’m working on a project where the client wants a cool sliding navigation effect. We’re implementing this with JavaScript/AJAX/DHTML.
One of the constraints is that pages can only be reached via certain other pages. For example, if you’re on the /portland/contact page and want to go to the /seattle/contact page, you’ll first slide up to /portland, then over to /seattle, then finally down to /seattle/contact.
After a while, it occurred to me that there were some similarities with another project I’ve been working on off and on for the last few years, byCycle.org, which is a bicycle trip planner a la Google Maps.
I had written a Python version of Dijkstra’s Single-Source Shortest-Paths (SSSP) for byCycle.org. That’s available on Bitbucket as Dijkstar (so named because it also does has the potential to do A*). I figured it wouldn’t be too hard to port the Python version to JavaScript, and it wasn’t.
There were a few snags, though. Most of it was just syntactic and semantic differences between the two languages. The biggest issue was that I use “heapq“ in the Python version to maintain the costs to previously visited nodes in sorted order. JavaScript has no priority queue implementation that I could find, so I came up with a different solution that involves updating an Object (AKA hash) with costs to newly visited nodes and sorting the keys to pick the next node to visit. I’m assuming/hoping the underlying sort implementation is highly optimized.
Interestingly, I think I found at least one bug in the Python version, although I’ve been using that version for a couple years now with no known problems, so it must only be applicable in certain edge (no pun intended) cases (or maybe it’s due to some difference in the languages–need to take a closer look). I think the JS version came out cleaner, too.
If anyone’s interested, I’m releasing this under an MIT license. You can get it from here. Note that it depends on the util module that you can get from here. The util module contains some other Python-inspired JavaScript, in particular a couple of functions for generating namespaces and classes. I might write another post about that at some point.
YUI TreeView with Ruby on Rails
Here’s some code I’m using to generate a dynamic tree view using an acts_as_tree model with slug and title fields, the TreeView widget from YUI, and a Rails helper. I chopped out some of the code for clarity, so all this does is create a menu with the titles from the model, but the basic idea is there to expand on.
Rails view/JavaScript
<script type="text/javascript">
var page_tree;
page_tree_init = function () {
page_tree = new YAHOO.widget.TreeView('page_tree');
var root = page_tree.getRoot();
<% generate_page_nodes(@root) {} %>
page_tree.draw();
};
page_tree_init();
</script>
Ruby
def generate_page_nodes(node, &block)
parent = node.parent
node_name = node.slug.gsub('-', '_')
parent_node_name = parent.nil? ? 'root' : parent.slug.gsub('-', '_')
js = <<-JS
var #{node_name} = new YAHOO.widget.MenuNode('<span class="node_title">#{node.title}</span>',
#{parent_node_name});
JS
concat(js, block.binding)
children = node.children
children.each { |c| generate_page_nodes(c, &block) } unless children.empty?
end






