MustEat.org

Last updated: 06:48AM 10/27/08

I didn’t see any good way to handle multilingual strings in Ruby for UI/Output etc.

So I whipped up ruby-resourcer, available on github at http://github.com/smarkwell/ruby-resourcer

An Example

    require 'Resource'
    r = Resource.new
    r.set(1,"Hello","en")
    r.set(1,"Hola","es")
    r.set(1,"Bork Bork!")
    r.get(1) #<= "Bork Bork!" 
    r.setDefaultTag("en")
    r.get(1) #<= "Hello" 
    r.get(1,"es") #<= "Hola" 
    r.save("file")
Last updated: 10:56PM 09/26/08

If you are looking to test a website automatically as a client, here are some free tools I’ve been looking at for that purpose.

Last updated: 12:48AM 09/05/08

I ran into the problem recently where I wanted to test some code that referenced a JNDI location pull out a DataSource object to then make a connection to a DB.

The issues arises that there doesn’t appear to be a memory based Context implementation that comes with Java. This is one of the annoyances of trying to unit test JavaEE code outside JavaEE. I decided to make use of Tomcat 6’s existing InitialContextFactory implementation called javaURLContextFactory so I could bind the locations during the test setup.

I did this using the binary packages from Tomcat 6.0.18 but I expect other versions could be used as well, considering the javaURLContextFactory class has been around since 4.0

So in the classpath your tests will run under, you need to add
  • catalina.jar
  • tomcat-juli.jar

Juli is required because some logging is attempted by the Tomcat context implementation.

Next I had to wrap the InitialContextFactory to provide an implementation of InitialContextFactoryBuilder. With this class I can set the InitialContextFactory at run time through NamingManager


package test.util;

import java.util.Hashtable;

import javax.naming.NamingException;
import javax.naming.spi.InitialContextFactory;
import javax.naming.spi.InitialContextFactoryBuilder;

import org.apache.naming.java.javaURLContextFactory;

public class TomcatInitialContextFactoryBuilder implements
        InitialContextFactoryBuilder
{

    @Override
    public InitialContextFactory createInitialContextFactory(
            Hashtable<?, ?> environment) throws NamingException
    {
        return new javaURLContextFactory();
    }

}

With these libraries and this class wrapper setup, I can now setup JNDI space from inside my test suites.

Before my test runs I setup everything up.


@BeforeClass
    public static void setUpBeforeClass() throws Exception
    {

        NamingManager.setInitialContextFactoryBuilder(new TomcatInitialContextFactoryBuilder());
        Assert.assertTrue(NamingManager.hasInitialContextFactoryBuilder());
        Context ctx = new InitialContext();        
        ctx.createSubcontext("java:comp");
        ctx.createSubcontext("java:comp/env");
        ctx.createSubcontext("java:comp/env/jdbc");
        ctx.bind("java:comp/env/jdbc/<location>", <DataSource Object>);
        ctx.close();
}

And now my code can access JDBC locations it expects. Or any other JNDI location I wish to setup.

Edit:

Jason Brittain suggests ServletUnit. You may also wish to look at Cactus

Any Suggestions? Contact Me

Last updated: 12:52AM 08/21/08

For my day job, I’ve been trying to find the right solution to Silent Single Sign On using IE talking to a Java EE Server. In this case I’m working on Tomcat.

I’m documenting my troubles and discoveries so other people who head down this path will have an easier path to walk, knowing what is minimally required.

Any code I develop related to this I hope to get released back to the community.

Last updated: 05:50PM 07/13/08

Only one program on a desktop can bind any particular global hotkey at a time. If two programs overlap, the first one to get up and running and make the API request gets the notification of the key press.

Considering this scenario, the easy possible for overlap, you would think most applications that have a global hotkey would allow what key they bind to, to be configurable.

I have been using a program called Slickrun as a convenient way to navigate into my computer, launch url’s and access arbitrary programs. By default it binds to Win+q to bring itself to the foreground ready for input. Since I’ve been using this for the past 5 or so years, so I’ve grown quite accustomed to the key combo.

Enter Microsoft Office Communicator 2007.

One of the global hotkeys it registers is also Win+Q. Except Communicator has no configuration options to say which hot key you wish to bind globally. I’ve done a cursory search through the registry but so far nothing. So I’m at an impasse. Do I disable auto start for communicator or do I attempt to learn a new key combination for slickrun?

Of course I will send feedback to Microsoft about this.

Last updated: 05:43PM 06/14/08

Microsoft

I have enjoyed my Xbox. Great network play in college with Halo, excellent games like Kotor, Fable, Jade Empire, and Psychonauts (which yes, I bought when it came out), and the final stage of being the primary DVD player. I would love to buy an Xbox 360, for wireless controllers, media center functions, and great games. Except I won’t because of your horrid failure rates. It has been almost 3 years since the console hit the market, and STILL buying one of those console is playing russian roulette, and I LIKE roulette. Looks like I’m going to be waiting for the next generation of your console, (with a 2 year wait time after release to watch for issues, like I did with the original xbox).

Nintendo

My former roommate had a Wii shortly after it’s release. A bit misguided about multi-player and the true power of having a networked device under the TV, still a excellent platform and I would love to own one. Except I can’t find one. I refuse to pay more then MSRP, camp out for it, or buy it in a bundle. I can’t order one from Amazon, I can’t walk into Target or BestBuy to pick one up. What is wrong? It’s been 2 years!

Summary

I’m a male 18-25, with the income of an established software engineer. I have the money to spend, I have the desire to spend, but I can’t. What sort of business model is this?

Last updated: 03:59PM 06/16/08
  • Look into
    • TaskTop and further work with Mylyn
    • Cactus + JUnit
    • Quartz Java Scheduling
      • How could JMS be improved with concepts from Quartz