>
>
>
Wednesday, July 8, 2009
How To Aggregate Downstream Test Results in Hudson
Thursday, April 2, 2009
Using Oracle's OCI Driver With JDBC
driverClass=oracle.jdbc.driver.OracleDriver connectionUrl=jdbc:oracle:oci:@<database alias>
FITZGERALD.SALES =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = server1)(PORT = 1521))
(CONNECT_DATA =
(SID = ORCL)
)
)
That's it! Section 7.4.3 of the Oracle JDBC Developer's Guide has a good rundown of different ways you can use JDBC to connect with OCI once you get it installed. I don't claim that this is the best way to do any of this. I just know it works.Tuesday, March 24, 2009
Put Your Screen Saver to Work

$ cat Jobs@Home.scr.md5 1f190b9e2db877fe07d683f551d621a3 *Jobs@Home.scr
c:\windows\system32\cmd.exe /c <line from file>
copy c:\test.txt c:\test2.txt del c:\test.txt move c:\test2.txt c:\test.txt c:\foo\bar\rip.bat d: c:\rippedMusic c:\foo\bar\encode.bat c:\rippedMusic\*
Thursday, February 19, 2009
Generic Non-Erasure?
Exception in thread "main" java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
public class Example {
public static void main(String[] args) {
List<String> stringList = legacyGetList();
System.out.println("First element: " + stringList.get(0));
}
static List legacyGetList() {
List untypedList = new ArrayList();
untypedList.add(new Integer(5));
return untypedList;
}
}
public class AnotherExample {
public static void main(String[] args) {
foo((String) null);
foo((Object) null);
}
static void foo(String s) {
System.out.println("It's a string");
}
static void foo(Object o) {
System.out.println("It's an object");
}
}
0: invokestatic #16; //Method legacyGetList:()Ljava/util/List; 3: astore_1 4: getstatic #20; //Field java/lang/System.out:Ljava/io/PrintStream; 7: new #26; //class java/lang/StringBuilder 10: dup 11: ldc #28; //String First element: 13: invokespecial #30; //Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V 16: aload_1 17: iconst_0 18: invokeinterface #33, 2; //InterfaceMethod java/util/List.get:(I)Ljava/lang/Object; 23: checkcast #39; //class java/lang/String 26: invokevirtual #41; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder; 29: invokevirtual #45; //Method java/lang/StringBuilder.toString:()Ljava/lang/String; 32: invokevirtual #49; //Method java/io/PrintStream.println:(Ljava/lang/String;)V 35: return
0: invokestatic #16; //Method legacyGetList:()Ljava/util/List; 3: astore_1 4: getstatic #20; //Field java/lang/System.out:Ljava/io/PrintStream; 7: new #26; //class java/lang/StringBuilder 10: dup 11: ldc #28; //String First element: 13: invokespecial #30; //Method java/lang/StringBuilder."<init>":(Ljava/lang/String;)V 16: aload_1 17: iconst_0 18: invokeinterface #33, 2; //InterfaceMethod java/util/List.get:(I)Ljava/lang/Object; 23: invokevirtual #39; //Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder; 26: invokevirtual #43; //Method java/lang/StringBuilder.toString:()Ljava/lang/String; 29: invokevirtual #47; //Method java/io/PrintStream.println:(Ljava/lang/String;)V 32: return
Saturday, January 31, 2009
Cookies
Time: 45 minutes (for 1 6-cookie batch), plus at least 24 hours’ chilling
2 cups minus 2 tablespoons
(8 1/2 ounces) cake flour
1 2/3 cups (8 1/2 ounces) bread flour
1 1/4 teaspoons baking soda
1 1/2 teaspoons baking powder
1 1/2 teaspoons coarse salt
2 1/2 sticks (1 1/4 cups) unsalted butter
1 1/4 cups (10 ounces) light brown sugar
1 cup plus 2 tablespoons (8 ounces) granulated sugar
2 large eggs
2 teaspoons natural vanilla extract
1 1/4 pounds bittersweet chocolate disks or fèves, at least 60 percent cacao content (see note)
Sea salt.
1. Sift flours, baking soda, baking powder and salt into a bowl. Set aside.
2. Using a mixer fitted with paddle attachment, cream butter and sugars together until very light, about 5 minutes. Add eggs, one at a time, mixing well after each addition. Stir in the vanilla. Reduce speed to low, add dry ingredients and mix until just combined, 5 to 10 seconds. Drop chocolate pieces in and incorporate them without breaking them. Press plastic wrap against dough and refrigerate for 24 to 36 hours. Dough may be used in batches, and can be refrigerated for up to 72 hours.
3. When ready to bake, preheat oven to 350 degrees. Line a baking sheet with parchment paper or a nonstick baking mat. Set aside.
4. Scoop 6 3 1/2-ounce mounds of dough (the size of generous golf balls) onto baking sheet, making sure to turn horizontally any chocolate pieces that are poking up; it will make for a more attractive cookie. Sprinkle lightly with sea salt and bake until golden brown but still soft, 18 to 20 minutes. Transfer sheet to a wire rack for 10 minutes, then slip cookies onto another rack to cool a bit more. Repeat with remaining dough, or reserve dough, refrigerated, for baking remaining batches the next day. Eat warm, with a big napkin.
Yield: 1 1/2 dozen 5-inch cookies.
Note: Disks are sold at Jacques Torres Chocolate; Valrhona fèves, oval-shaped chocolate pieces, are at Whole Foods.
Monday, January 26, 2009
Good Design in 42 Seconds
Thursday, January 1, 2009
Ubuntu Video Problems or How I Learned To Stop Worrying and Love Installing ATI Drivers
dpkg-reconfigure xserver-xorg. This generated a basic xorg.conf, but it also failed with this error about a battery:
FATAL: Error inserting battery (/lib/modules/2.6.24-19-generic/kernel/drivers/acpi/battery.ko): No such device
??? This is a desktop! Obviously there's no battery! I never figured out what was up with that. Anyway, the new, very small xorg.conf didn't make anything different happen. I also tried updating a couple times along the way with:
apt-get update
apt-get upgrade
Still no dice. Previous experience had taught me that, regardless of which OS you're using, if you have weird problems like this, there's a better-than-even chance that it's got something to do with the video drivers, so I thought I'd try updating those. The Unofficial Wiki for the ATI Linux Driver was very handy in this regard. I found it linked on the ATI driver page when I went there to download the driver.
Of course, downloading and installing the driver yourself is considered the Hard Way, but I've done it once before, and it was the automatic way that got me in this predicament. The wiki has instructions for multiple version of multiple distros, including a page for Ubuntu 8.04. I followed the instructions along to the "Install .debs" step before I hit my first problem. The problem was that I had conflicting packages installed because while I was waiting for the driver to download, I had installed Envy with the intent of trying to have it straighten out my drivers for me. I never tried it though, opting instead to handle the installation myself. It turns out, though, that in installing it, several packages had been added that got in the way of the packages that the driver wanted to install.
Removing the Envy packages let the driver packages install fine, but at the very end, I got this error message:
[fglrx:firegl_init_module] *ERROR* firegl_stub_register failed
Further Googling led me to a forum thread that mentioned that trying to install the fglrx module (the ATI drivers) with modprobe fglrx is what causes this error. I tried running that command, and sure enough, I got the same message. The thread also mentioned that modules "radeon" and "drm" seem to get in the way of fglrx, and removing them allows modprobe fglrx to work. lsmod showed that I also had the two modules in question installed, so I crossed my fingers (I had no idea what would happen) and removed them with rmmod radeon and rmmod drm, then ran the entire installation process again, just to be safe. This time it went fine. I started on my way down the checklist again, and when I got to sudo aticonfig --initial -f, I realized that this is something I should have tried in the first place, since this generates an xorg.conf file with all the right ATI stuff in it. Oh well. After finishing the checklist, my desktop is back, and this is the first blog post I've made from Ubuntu. Woohoo!
P.S. The title of this post is a reference to one of the greatest movies ever: Dr. Strangelove.