November 7th, 2010
I've been experimenting with OpenID for a couple of years now. My first OpenID was with JanRain's "MyOpenID" service as a delegate for my homepage. At the time, the service was amazing. They supported client certs, multiple profiles... the works.
Now it saddens me to report that JanRain's MyOpenID is effectively dead, as far as anyone can tell. For over a year, there has been a serious malfunction with the client certificate feature, and no indication from JanRain that they are even aware of the problem. I have tried to contact them via multiple email addresses (all of which bounced my message) and via their contact forms. On both their official UserVoice thread and a GetSatisfaction thread, many users report the same issue, but no JanRain representatives weigh in.
For a replacement service, I recommend switching to Clavid. And remember, delegation is your friend.
No comments | Posted in -no category-
October 28th, 2010
I'm currently living in a 2-unit apartment near Boston, MA. Over the last 2 weeks, there have been three incidents of a starling getting into the basement:
- Bird hanging out in basement, seemed pretty tame (only maintained 4' distance.) Shooed out the basement door.
- Found a dead starling. We left a dish of water out after this, as well as a tray with some stale bread. (Didn't know if it had died of thirst or exhaustion.) Heard something fluttering in the heating duct, so I left the basement light on, too.
- Found a live starling hanging out near water dish, similar to first. I managed to walk up to it (after a very brief chase) and catch it with my hands. When my girlfriend opened the basement door, it managed to free itself and fly out.
Based on the third incident, it seems the "tameness" stems from exhaustion. Our best guess is that the gas-powered water and heating exhaust into an otherwise disused chimney with an improperly screened cap. (I haven't confirmed the existence of a chimney, but the exhaust ducts do lead into a brick column in the basement.)
Now I just have to figure out 1) how to aid any further birds that get in, and 2) how to screen the (assumed) chimney without trapping anything else inside. Any thoughts?
Update 2011-02-09: Discovered a starling in the dining room. There was birdshit everywhere. This was apparently due in part to it having eaten a good deal of my aloe plant, which is a laxative. *No idea* how it got into living space -- all the doors were closed.
No comments | Posted in -no category-
May 22nd, 2010
I like using HTTPS whenever possible. Usually this is as simple as adding a single letter to a URL, but some sites have separate domains for SSL. The Wikimedia sites are a great example of this; they share the domain secure.wikimedia.org and use the first elements of the path to specify the site.
Now, I could have set up a Greasemonkey script to redirect me once I hit an unsecure Wikipedia page, but then it's too late. (I'm usually going directly to the article via web search results.) I could also use Greasemonkey to rewrite URLs in web pages, but that's a mess. Instead, I wanted to intercept any requests to unsecure Wikipedia and redirect them on the fly, before they even left my machine. Here's how I set up my browser to always use SSL for Wikimedia sites:
- Have Apache with virtual hosts and Mozilla Firefox with FoxyProxy
- In my default virtual host:
<Directory /var/www/>
RewriteEngine On
RewriteBase /
RewriteCond ${HTTP_HOST} !.*mycomputername.*
RewriteRule . rewriter.php [L]
</Directory>
- And this file at /var/www/rewriter.php:
<?php
$host = $_SERVER['HTTP_HOST'];
$path = $_SERVER['REQUEST_URI'];
// ensure path is not of form http://...
if(strpos($path, '/') !== 0) {
$start = "http://$host/";
if(strpos($path, $start) === 0) {
$path = substr($path, strlen($start) - 1); // include slash
} else {
die();
}
}
if(preg_match('/([a-z0-9]+)\.wikipedia\.org/', $host, $m_domain)) {
header("Location: https://secure.wikimedia.org/wikipedia/{$m_domain[1]}{$path}");
die();
}
?>
- Then set up a proxy in FoxyProxy, early in the chain, called "rewriter". Set it to a SOCKS 5 proxy at localhost:80, using the whitelist regex
http://[a-z]+\.wikipedia\.org/.*
Obviously, the setup as written here only gets Wikipedia, but it could easily be expanded to Wiktionary, Wikibooks, Wikimedia Commons, and other sister sites.
I'll delete any tech-support questions in the comments area, so don't ask them. This guide is for advanced users only. Discussions of potential improvements are welcome.
1 comment | Posted in -no category-
March 14th, 2010
One of the constant dilemmas I encounter in software development is where to put files. In theory, it doesn't matter; I can set the lookup paths and file references however I want, and the software will compile and run. In practice, I feel it is one of the biggest factors in how comfortable I am developing a project. As a programmer, I need to be able to reload a big ol' wad of context whenever I switch projects, and the directory structure serves in part as external memory. Refactoring, collaboration, permissions, and deployment are all made easier by proper directory structures and naming. Code rot, the scourge of long-running projects, is multiplied by poor initial code management decisions. In short, file management makes a lot of little differences that can make or break a project in the long term.
Usually, the standard hierarchical filesystem model is perfect. I have a project Foo, it contains folders for source, compile info, and binaries, and each of those folders is probably hierarchical as well. The source and binary folders usually have matching subdirectory structures, but that particular duplication of structure is OK, because the binaries folder is generated, not edited; I never have to think about changing both directory structures at the same time.
This standard model fails when I have to work with multiple related projects. If I put the Foo and Bar projects side by side, I notice that both have src and bin directories. Perhaps I should have a src folder and bin folder instead, each subdivided into Foo and Bar directories! Each has advantages and disadvantages that are immediately obvious. This is known as the problem of cross-cutting concerns, where there are strong yet orthogonal organizational principles that compete for priority.
I like to imagine that we would be better off with a new filesystem model, perhaps one based on matrices, tagging, smart searches, filters, or DAGs. I don't know what the right answer is, but I'd like to hear your thoughts on the matter.
No comments | Posted in Challenges in software engineering
August 13th, 2009
As javascript engines increase in speed and efficiency, it is becoming feasible to write compilers and interpreters in javascript to allow webpages to run alternative programming languages not normally supported by browsers. See processing.js, for instance: A graphics library that runs a Java-like language in the browser.
An initial hurdle facing developers of these toolkits is the problem of loading source code. Javascript is loaded and executed natively in the browser environment, and it would be nice to load alternative language sources in a similar manner. So, today I wrote a library to do that.
The library, called LoadForCompile, is invoked with a MIME type and a callback. It searches the DOM for script elements with the given MIME type, loads their sources, and passes them to the callback. There is a very simple demo page with a "compiler" that displays whatever source code it is provided. Following is the documentation for the library.
Description
LoadForCompile will retrieve alternate-language source code and pass it (in order) to onLoad. Any sources that cannot be retrieved will be ignored by default.
If the onFinish argument is provided, it will be called when all sources have been loaded and passed.
If the onError argument is provided, it will be called with (src, k), where src is the offending URL and k is a continuation of the loading process, so the relying client may continue or entirely halt the loading process by calling k or not calling it, respectively.
Usage
- Place script elements in your HTML document with desired MIME type.
- Each script element may have a
src attribute, an inline body between the opening and closing tags, or both. The body is guaranteed to be called immediately after the associated remote source, or not at all.
- Finally, call LoadForCompile with the MIME type and callbacks.
Specification
LoadForCompile searches the DOM for any script nodes bearing the target MIME type. For each one, it records the src attribute and the contents of the text node, if any. It is an error to have non-text elements as children of the script node, and in such a situation the behavior of this library is unspecified.
The library uses asynchronous requests to load any remote resources specified by src attributes. This loading occurs in an unspecified order. If any remote source fails to load, the library will mark that source (and any associated inline body) as invalid. If onError is provided, it will be called with a continuation function that will resume progress. (If the continuation is not called, no additional callbacks will be made.)
Note that if onError is provided and does not call the continuation, onFinish will not be called.
The library is in version 0.2 and is licensed under the LGPL.
No comments | Posted in Software