Friday, December 12, 2008

online money managers

This past month I started tracking all my expenses online, partly because we've hired a financial planner and she keeps asking how we spend our money. (Rude, I know.)

I started with Mint.com (because a vendor of my employer recommended them), and I'm very happy with their service. They:
  • They import from all my accounts (so far).
  • They categorize each expense automatically (and they're usually correct).
  • I can change the categorizations, and save the preference so that future expenses with the same description are categorized the same way.
  • I can split expenses and categorize parts separately.
I only have two complaints so far:
  • I cannot manage my cash.
  • While I can add my own categories, I cannot change or remove the predefined ones.
Coincidentally, today I found two other services that do much the same thing. I won't be switching yet, but I'll be watching for mothers:
  • Wesabe.com is very interesting because they want to make it a community that gives suggestions to one another; in addition, they have some APIs to help you work with your account data... they just want to make it really easy to analyze your finances and get help managing them. The current show-stoppers: they require a Mac or Windows install, so I cannot manage things from whatever computer I'm on; they currently only work with "USAA, Citibank, Chase, Wachovia, CapitalOne, and Bank of America"; and their APIs don't yet aggregate account data.
  • Egg.com seems to offer services similar to Mint, plus in-house financial services like loans, savings accounts, etc. The current show-stopper: it requires a Windows ActiveX install.

Thursday, December 11, 2008

Ancient teleconference demo... of mouse, screen-sharing, hypertext, and more!

Yesterday was the 40th anniversary of what The Register calls "The Mother of All Demos". They're not kidding. You can see it in a video that captured the presentation. Here are some highlights:
  • It starts out with 1 minute 30 seconds of text explaining how the whole production was set up, after which he jumps into his demonstration.
  • He starts showing the hyperlinking at 15:50.
  • He explains his mouse and his one-handed text entry device at 27-30 minutes in.
  • Someone else joins in to work on the same screen at 57 minutes in.
It's fascinating to watch, with all the glitches he hits and the things he has to explain along the way. Be sure to read the article and the explanatory text at the front of the video to get a full appreciation of this demo. It's history right before your eyes.

Tuesday, December 9, 2008

Jolly Old Mathematics

So I was reminiscing with Jen about Helaman Ferguson and creative math, so I had to google for fun with math for this Christmas season. I found a few lists (this is probably the best one), but here are the specific activities that looked like the most fun out of the dozens I perused:


Happy Holidays!

---

While I'm here, I've got to mention two cool fractal sites, even though they're not Christmas-oriented:

Tuesday, November 18, 2008

a few notes about the Java ClassLoader

I found a case today where the clazz.getResourceAsStream(String) retrieved a resource but the clazz.getClassLoader.getResourceAsStream(String) failed to find it. Weird.

I never figured it out, but I came up with the following as I tried:

  • There is no way to get all the entire path that is being searched. I always come to this point and try, but it's a hard fact of Java. I did find this blog entry that explained how you might patch the ClassLoader.toString() methods. But read on...
  • Even for URLClassLoader classes, it looks like it'll search through directories that are not found by the getURL() method (so that previous blog entry won't catch them all). I found this by running some unit tests in Maven with the method that follows, and it was retrieving things from the 'classes' and 'test-classes' directories that didn't show in the getURL() results.
  • If you try a call to getResource(""), it'll show some of the directory paths that are in the search path. I don't know for sure that this is true because I can't find it documented, but it seems to work. So the following method will show all the URL and path resources up the line from a given loader:

private static void showAllResourcePaths(ClassLoader loader) {
try {
String indent = "";
for (ClassLoader nextLoader = loader; nextLoader != null; nextLoader = nextLoader.getParent()) {
System.out.println(indent + " loader " + nextLoader);
for (Enumeration<URL> urls = nextLoader.getResources(""); urls.hasMoreElements(); ) {
URL url = urls.nextElement();
System.out.println(indent + " path: " + url);
}
if (nextLoader instanceof URLClassLoader) {
System.out.println(indent + " URLs: " + Arrays.asList(((URLClassLoader) nextLoader).getURLs()));
}
indent += "-";
}
} catch (Exception e) {
e.printStackTrace();
}
}

  • Using that method will show you most of what you want because, in my tests, all the class loaders in the ancestry turned out to be URLClassLoaders.

What is the difference between the clazz.getResource and clazz.getClassLoader().getResource methods?

Monday, November 17, 2008

online to-do lists

I've been keeping my to-do list in a text file on my phone, and that together with my phone's calendar and my email are the things that pretty much run my life. Someday I'm sure that there will be a way to have all of those things integrated the way I want, most likely through an online service. To do so, they'll have to:
  • make it easy to make notes wherever I am, ideally with Jott
  • allow me to attach a "context" (and a time estimate)
  • integrate with a calendar
  • allow for task dependencies
Today I figured it was time again to check around and see if today is that day. It looks like it's not. The dependency feature is the hardest to find, and I'm a bit surprised it's still not very widespread. Here's some of the info I've gleaned from about a dozen sites:

Remember The Milk is integrated with Jott for free, which makes it most attractive for a trial; I'd like to try Hivemind for their dependencies, and I will if I do a paid subscription to Jott (eg. pay-as-you-go, because Jott is critical but I use it rarely).

Thursday, October 30, 2008

integration tests with Wicket and Spring

I had a bear of a time getting my Wicket tests to work with services injected by Spring.

I started with the helpful Wicket-Spring unit-test instructions here; this got me through a basic test. Unfortunately, I must use Spring-managed services from my main AuthenticatedWebSession class since I'm using the standard Wicket "Auth-Roles" security (simply, without Acegi); Wicket has a helpful way to tie with Spring when it comes to the WebPage classes, but this doesn't work for the things I'm using in the main WebApplication or WebSession classes.

I found another project that uses Spring's test class AbstractTransactionalDataSourceSpringContextTests as it's parent class, and this proved to be my salvation. Basically, I extend that class and add the following 2 methods:

protected ConfigurableApplicationContext createApplicationContext(String[] locations) {
context.setServletContext(new org.springframework.mock.web.MockServletContext());
context.setConfigLocations(locations);
context.refresh();
return context;
}

protected String[] getConfigLocations() {
return new String[]{"context/backoffice-webapp.xml"};
}


Then I have to override the "onSetUpBeforeTransaction" method instead of the traditional JUnit "setUp" method:


@Override
protected void onSetUpBeforeTransaction() throws Exception {

super.onSetUpBeforeTransaction();

AuthenticatedWebApplication authenticatedWebApp = new WicketApplication() {
@Override
public void init() {
addComponentInstantiationListener(new SpringComponentInjector(this, TestHomePage.this.applicationContext));
initForAppAndTests(); // this is where I set up my global services, called by WicketApplication.init() as well
}
};
tester = new WicketTester(authenticatedWebApp);
}

That made it all work.

BTW, although I'm using Spring 2.5.5, the latest spring-mock library is only 2.0.8.