Languages and Their Library Cultures
I saw an interesting blog post today titled Why I stick with Perl. In short, the author's reason for sticking with Perl was that he believes it to have the best "library culture." A strong library culture is more important to him than the language itself.
What does "library culture" even mean? I would define it as the practices, beliefs, and institutions regarding the sharing of modular code. In other words, it refers to the systems for sharing code and the practices of developers concerning those systems.
Perl certainly has a very strong library culture. CPAN is one of the most extensive library repositories out there. In my experiences with the Perl community, the use of CPAN has always been encouraged, and I've generally been pleased with code quality and documentation.
Besides Perl, this made me think about other library cultures. I never realized how drastically different some of them are. Here are my thoughts on a few of the more interesting cases.
Ruby on Rails
Ruby on Rails is very much so a cut and paste world. Despite the existence of RubyForge, I still find myself grabbing code from blogs, wikis, or some random guy's self-hosted repository way too often. It's always a little unsettling.
For example, a typical plugin hunt involves going to the Rails wiki, grabbing the plugin from a random guy's subversion repo, making the changes suggested on the Rails wiki, then going to a forum or blog and copy-pasting the changes suggested there. After all this work, you later find out that some other guy did all this and checked it into GitHub in a new repo. Now whose changes do I follow, the original random guy's repo or the new repo from a new random guy? And who are these people anyway? It all feels very questionable.
PHP
PHP provides so much in the core extensions that I rarely need to look outside of what's already there. Whenever I do need something, PEAR or a professional framework like Zend Framework often has it. I can't think of a single time I ever needed code from a random repo.
C# and .NET
.NET is a monstrous library which has everything under the sun. Microsoft also provides great documentation. Due to these two factors, C# doesn't even really need a strong library culture, it already has a behemoth with a ton of money taking care of it.
Microsoft can't cover everything, though, so they'll always be the need for other libraries. Unfortunately, the third-party library culture isn't as open as it is in languages like Perl. The Microsoft world encourages licensing libraries instead of collaborative repositories.
Attended My First Boston Meetup
Last night I attended the Boston Web-Based Business Startup Group, an informal Meetup.com event. About 11 people showed up, and the format was a roundtable discussion. We each took 10 minutes to explain what we do and bounce questions off the group. It was both informative and a good reality check.
I attended the meetup with the two guys from Pandemic Labs, a viral marketing startup, whom I met them through Henry. They turned out to be quite a hit at the meetup due to everyone's curiosity about what they do and how it might help them.
With this event past me, there are numerous others that I plan on attending. At the meetup, Dale from Lead Gather informed me that The Web Innovators Group attracts a good crowd. The guys at Pandemic told me about the Massachusetts Innovation and Technology Exchange. MITX is a more formal organization with membership dues, but it sounds very promising. Lastly, I want to attend workshops and free counseling sessions offered by SCORE Boston.
The Challenge Is Motivation, Focus, and Effort
I should probably give an update on what I'm up to. I have not yet done so on my blog, and since this is my blog, it's only appropriate that I at least explain something.
In January of 2008, I left my job at Microsoft to start a software company with Henry Cipolla, a classmate from my days at Boston University and also an ex-Microsoft employee. What we aim to develop is mostly a secret for now, but it will be on the web, and it will be targeted at consumers. It will rely on the wealth of social information hitting the web, and it will hopefully profoundly impact the lives of my family, friends, colleagues, and everyone else.
Wordpress and .htaccess Password Protected Directories
I tried to make a password protected directory using a .htaccess file earlier today and found out that the root Wordpress .htaccess file causes a little trouble.
The situation looks something like:
- /
- .htaccess <- From Wordpress
- /ProtectedDir
- .htaccess <- My file
As of Wordpress 2.3.2, its .htaccess file looks like this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
This lives at the base of Wordpress install, which for me happens to be the root of my web site. The rewrite rule throws any URL that leads to a non-existent file to Wordpress' index.php. This lets Wordpress do search engine friendly URLs and custom 404 handling.
The problem here is subtle. In order to do password authentication, the web server needs to serve up a "401 Unauthorized" header and optionally an error document. My server defaults to a specific error document path, but I have not created a document at that path. However, Apache still passes the predefined 401 document path through the rewrite rules in an attempt to use it. Since it doesn't exist, the request gets snagged by the Wordpress rewrite rules and index.php. The end result is that what should have been a 401 page now turns into a 404 and you can't authenticate to the directory.
The solution is simple: override the non-existent, predefined error document path using the ErrorDocument directive in either of the .htaccess files mentioned above.
You have several options. You can either use Apache's default hard-coded string for the error document by specifying:
ErrorDocument 401 default
Or you can use your own hard-coded error string:
ErrorDocument 401 "Unauthorized access"
Or you can create a 401 document and point the server to it like so:
ErrorDocument 401 /401.html
Pick one of those methods and your password authentication should work. Remember, the error document file must exist if you pick the last method.
Note that the same problem can occur with other HTTP error codes, so be on the lookout for other situations where Wordpress might bite you.
Updated Jan. 27 thanks to a suggestion made in this web forum post.
Physics in Flash
Coincidentally, Adi and I were just talking about physics engines in Silverlight the other day, then I spotted these two posts on Reddit about physics engines in Flash:
- xavierenigma's next physics game - This one incorporates objects with hard joints, but has no other features yet.
- Flash Doodle - Includes anchor points, bubbles with upward force, squishy lines, loose lines (rope). Lacks hard joints.
Statistics about Americans
Time Magazine has an interactive representation of some statistics about Americans on their web site. How much do we drink? How much free time do we have? How happy are we on the job? How much time do we spend commuting? These are some of the stats they show. I particularly like the "City Population Shift" tab on the Commute map. It shows you how people shift in and out of major cities during the day/night cycles.
Also, as an interesting aside, I managed to find a draft version of this piece. It looks like Time forgot to remove it. Check out the broken version here.
Giving Stuff Away on the Internet by Scott Adams
I found an article on the Wall Street Journal's web page titled "Giving Stuff Away on the Internet." It's written by Scott Adams, creator of the Dilbert comics. The arcticle is a well written piece about problems Adams faced "giving stuff away" for free on his blog and web sites, especially where it concerns his non-Dilbert work.
One of My Pet Peeves: Blurring Sensitive Information
When I'm browsing the web, occasionally I'll happen upon an image where a portion is blurred or pixelated to block sensitive information such as a number. This irks me to no end, because as this article by Dheera Venkatraman demonstrates, blurring can be cracked in the same way one might crack a weak password, with a dictionary attack.
Why would someone blur an alphanumeric string when they could just as easily erase or cover it altogether? This is a classic example of having good intentions but making poor choices. I can understand a blurred face, but something as easily cracked as short numbers... you can do better Internet. Dheera sums it up much more eloquently than I can:
"Remember, you want to leave your visitors with NO information, not blurred information."
Cross Country Trip a Success
Finished the trip at about 9pm eastern time today, making for a total travel time of four and a half days. I'll post some pictures soon along with links to travel logs on the Pansy Patrol web site courtesy of Henry and Clint (whom I traveled with on the trip).
Starting My Cross Country Trip
I'm off on my cross country trip going from Seattle to Boston. The trip should take me five to six days, and I'm doing it with two friends and four vehicles between us. I'll try and snap some pictures along the way.