I recently bought three albums: Paramore's "Brand New Eyes", Rise Against's "Appeal To Reason", and Kings of Leon's "Only By The Night". So far, "Brand New Eyes" is the one grabbing my attention with several good songs and some variety of style. And, as always with Paramore, Hayley Williams' voice is amazing.
After "Ignorance", the angry song getting play on radio (angry songs are always fun to get into and sing along with), "Brick By Boring Brick" is my next favorite on the album. After listening the song and going over the lyrics on Friday night, we watched Dollhouse, and the ending of the show reminded me strongly of one verse:
Well, if it's not real You can't hold it in your hand You can't feel it with your heart And I won't believe it But if it's true You can see it with your eyes Oh, even in the dark And that's where I want to be, yeah
While it doesn't match the song overall (on Dollhouse, it wasn't Sierra's choice to be in a "relationship" that wasn't real), the match up of Sierra recognizing her love for Victor even without any memory of him and "if it's true, you can see it with your eyes, oh, even in the dark" connected to me. Especially as Diane and I had been discussing how much to read into the "even in the dark" part of the song (balancing the fantasy/escapism the song is against vs "true/real" dreams/faith).
We watched Gran Torino last night, which was better than I thought it would be. Now I'm looking forward to watching a football match (Arsenal v West Ham) and a football game (Dallas Cowboys v Atlanta Falcons) today.
Instead of working on the conversion of the blog to Webby, I spent much of the day playing with jQuery and JavaScript. A good portion was mostly wasted time attempting to make the loading of the syntax-highlighting scripts more dynamic. While this ultimately failed, it did get me to re-learn a lot of JavaScript and jQuery.
Rather than put that time completely to waste, I decided to prettify the archives section. Without JavaScript enabled, you get a linked list of links for each month of each year that I've published something. Now, with JavaScript, I transform that list of links into drop-downs for each year, where you can select the month within the year, and it will take you to the archive page for that month.
Now, for the code. First, on each blog page (via the template), I load my JavaScript file, and I load jQuery via Google AJAX Libraries API:
<script type="text/javascript" src="/js/main.js"></script>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('jquery', '1.3.2');
google.setOnLoadCallback(function() {
prettify_archives();
});
</script>
This runs prettify_archives function:
function prettify_archives() {
var years = [];
$("#archives > ul > li").each(function() {
var year = new RegExp(/\s(\d{4})/).exec($(this).text())[1];
if ($.inArray(year, years) == -1) {
years.push(year);
}
});
years.reverse();
var html = ['<h4 style="margin:0;">Archives</h4>'];
$(years).each(function() {
html.push('<select style="width: 11em;" ' +
'onchange="document.location.href=this.options[this.selectedIndex].value;">');
html.push('<option selected="selected">' + this + '</option>');
$("#archives > ul > li:contains('" + this + "') > a").each(function() {
html.push('<option value="' +
$(this).attr('href')
+ '">'
+ $(this).text()
+ '</option>');
});
html.push('</select><br />');
});
$('#archives > ul').replaceWith(html.join("\n"));
}
Labels: meta, programming, web
So, I stayed up way too late last night uploading version after version of this website. I updated the version of the syntax-highlighter I used on the one code sample I've posted. Nothing special there, but the fall-back when Javascript isn't enabled is nicer, as it's a pre-tag, instead of a text-area like before.
I fixed all the pages to have the extension .html instead of .shtml. The .shtml was leftover from when I used to use server-side-includes instead of a combination of Blogger templates & Webby layouts to handle common layout issues. Here's the content of the .htaccess file I used to make sure old links are given a permanent (301) redirect to the new extension:
RewriteEngine On RewriteBase / RewriteRule ^(.*)\.shtml$ /$1.html [R=301,L]
During the process, I noticed that Blogger wasn't producing an archive index page anymore. So I added archives to the sidebar for each blog. I made my css rules a bit more generic by making sidebar sections a class, instead of duplicating rules for different ids.
All of this took a bit longer than it should because any changes on the Blogger side required republishing the whole site (actually twice, once for the main blog, once for the politics blog). Whereas, for the non-blog content, I could run Webby locally, rsync it to my VirtualBox Ubuntu Server VM, and test it locally. So my next task is to figure out how to turn an export of this blog into Webby source files so that I can manage the whole process locally (and get my blog posts into version control as a bonus).
Labels: meta, programming, web
Despite the utter wasteland that is this blog, I've decided to start posting to yet another place on the internet: Twitter. The theory goes that if you're interested in knowing the minutiae of my life, you can follow me on Twitter (or subscribe to my Twitter feed or what have you). I, knowing that everyone looking at my Twitter posts has implicitly consented to being bombarded with inane details about my day, can safely post such details with the concern of them being "blog-worthy", or even "Facebook-status-worthy".
Now, if only I can do something interesting, I may have a reason to post something to my blog again...
This week I'm having to finally end my use of two web applications from major vendors. Bloglines had several of my feeds not update properly from June 3 through June 17th. I still haven't received any follow-up e-mail regarding the issue. Besides, for a feed-reading application, you'd think Bloglines could manage to communicate to its users through, I don't know, some kind of syndicated XML feed? On the 16th I was fed up with the lack of a fix, and the lack of a response, so I switched over to Google Reader. Sure, on the 17th Bloglines finally fixed the issue, but it was way too late by then. Getting my 309 feeds into Google Reader went fairly smoothly; a few folders weren't created so I had make the folders and place the feeds back into them. I'll miss Bloglines true "keep unread" or "pinning" feature, as well as the ability to group posts by the feed when reading a folder. But I'll get used to Google Reader's way of doing things if it means a reliable service that doesn't feel abandoned, despite its ownership by Ask.com. Plus I'll also get a better feed sharing mechanism, and finally have a Feed Search that works (despite Bloglines being owned by a search company, there's was never helpful).
The same basic experience repeated itself this week, this time from Yahoo. While the majority of people use del.icio.us for online bookmarking, I'd jumped on Yahoo's other service: My Web, mostly because it saved the page contents for you to search through in addition to the page title and tagging. However, a month or so ago, the RSS feed for my public bookmarks started showing junk. That was fixed within a week, but it started happening again this week. Now I can't even log in to the site. I filled out some tech support form I found on Yahoo (not that easy to find), but I've gotten no response. I've been able to access the bookmarks through another view (Yahoo's "My Bookmarks"), exported them, and am now importing them to del.icio.us. Hopefully Yahoo will maintain that a little better.
I guess in once sense this is same feeling everyone who bet on one of several competing technologies and lost feels. There were real benefits that led me to pick the apps I did, but the world didn't agree, and now I've paid the price for sticking with losers too long. Luckily some level of data portability has made that price a lot lower than it could have been.
Update: There are two new feeds you might want to track due to this change:
You can also get these changes automatically using my all-in-one Yahoo Pipes feed.Labels: web
You know my blog's neglected when I don't even think to announce a change of job until the weekend after starting at the new place. On Monday I started working at Cormine Intelligent Data.
I just watched Definitely, Maybe with Diane as our Valentine's day thing. It was fantastically cute and sweet. Ryan Reynolds was funny and charming, as usual. Isla Fischer was very likeable and adorable. Abigail Breslin, however, stole the show as the precocious and completely sweet daughter. I found the movie very enjoyable, though I am a total sucker for all forms of romantic comedies.
The main changes from 1.0 are:
propEqLabels: programming
Due to significant decreases in productivity, the United Nations announced today that it was banning April Fool's Day. They also cited human rights violations, stating that the shame felt by those who were fooled infringed upon the inherent dignity of all human beings. A follow-up proposal to categorize all practical jokes as torture under the Geneva Convention is still under deliberation.
Labels: humor
I've released EasyMock-PropertyUtils 1.0, and it's available in the Maven repository. If you have issues, post them at the Google Code site. If you use it, just post a comment here to let me know.
Labels: programming
While I've been frustrated by Bledsoe's consistency, I was never among the Dallas Cowboy fans that was calling for Tony Romo to replace Bledsoe. I didn't think an unproven quarterback could make much difference. But the drive I just watched Tony Romo lead was very impressive. No matter how tonight's game finishes, I see Romo as the quarterback for the Cowboys for the rest of the season. The biggest benefit: it looks like Dallas games will be more exciting on the offensive end.
Update: Well, Romo made enough mistakes to make my prediction that he will be the QB the rest of the season questionable. I think I'd still prefer Romo, but I'm not sure if Bill Parcells will agree.
Labels: sports
I've recently finished reading all of Steve Yegge's blog-rants. The overarching theme is Steve searching for ways to do better at software development. For instance, Being the Averagest on why many programmers aren't trying to get better, and Practicing Programming on how to get better for those who listened and decided they want to try. He also chronicles his search for a better programming language. I suggest reading all of the essays; hopefully they'll inspire you to be a better programmer, and you can take advantage of the work "Stevey" has done to guide you down the path of improvement. Stevey wrote all these articles while working at Amazon; make sure to also check out his current blog now that he works at Google.
Labels: programming
My brother, Scott, just got married last night. Congratulations Scott and Dana!
I'm looking for feedback on my XPath Replacement Maven Plugin. It's barebones right now; please send me any ideas you have on how to make it better, or just let me know if you'r even interested in it. The goal of the plugin is to allow you to do configuration (similar to normal Ant/Maven filtering), but without requiring placeholders so that your source version has a valid value that let's a developer get going straight from source.
I also updated the EasyMock Property Utilities site to include the example posted here on the blog.
Labels: programming
Here's the promised example of how to use my EasyMock-PropertyUtils library. It's a TestNG test class with two test methods. The first, testSayHelloTo() uses the single-property matcher test. The second, testSay() uses the multiple-property matcher test by supplying a Map of property names to property values. If you haven't used EasyMock before, this should also serve as an example of how EasyMock can allow you to unit test in isolation a method that interacts with another class. Check out the EasyMock Documentation for more information.
package test;
import static com.stephenduncanjr.easymock.EasyMockPropertyUtils.propertiesEq;
import static com.stephenduncanjr.easymock.EasyMockPropertyUtils.propertyEq;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
import java.util.HashMap;
import java.util.Map;
import org.testng.annotations.Test;
/**
* Test the Service class.
*/
public class ServiceTest
{
/**
* Test the sayHelloTo method.
*/
@Test
public void testSayHelloTo()
{
String address = "someone@example.com";
MessagingService messagingService = createMock(MessagingService.class);
messagingService.sendMessage(propertyEq(Message.class, "address", address));
replay(messagingService);
Service service = new Service();
service.setMessagingService(messagingService);
service.sayHelloTo(address);
verify(messagingService);
}
/**
* Test the say method.
*/
@Test
public void testSay()
{
String address = "someone@example.com";
String text = "some text";
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("address", address);
properties.put("message", text);
MessagingService messagingService = createMock(MessagingService.class);
messagingService.sendMessage(propertiesEq(Message.class, properties));
replay(messagingService);
Service service = new Service();
service.setMessagingService(messagingService);
service.say(address, text);
verify(messagingService);
}
}
Labels: programming