2006-12-27

Firefox: An unknown error occurred while printing

Update 2009-03-30: Here is a more reliable (but slightly more severe) way to work around this problem.

Have you ever tried to print something from Firefox and gotten an error message telling you that an unknown error occurred while printing? I have, and I know at least a few other people have had this problem. Apparently, this is an old bug, and the-edmeister has the fix:

type about:config in the URL bar and hit Enter
Preference name = print.print_printer
Right-Click that preference and select Reset, then restart Firefox.
See if Firefox is printing any better.

I usually can print one document after that, and I have to do it again to print another document. This solution is far from perfect, but it's good enough for now.

2006-12-22

Pocket Word: Error opening file

I keep notes in a Word document, sometimes on my PC and sometimes on my Pocket PC. I use OpenOffice.org 2.0 Writer as my editor, and ActiveSync 4.2.0 (Build 4876) to synchronize the file between the PC and the Pocket PC.

Recently, the Pocket PC had trouble opening the document. When I tapped the file name to open it in Pocket Word, an error window appeared, and Pocket Word closed the document before I could use it. The error window read:

Pocket Word        ok
Error opening file

It turned out there were two problems with my Word document. First, I had typed an email address into it. OpenOffice automatically turned it into a hyperlink with a mailto: URL. Second, I had pasted some hyperlinks from Firefox into the document. OpenOffice did the right thing, formatting them the expected way. Pocket Word was barfing on these hyperlinks. I removed them from the document, re-synced, and Pocket Word was happy again.

2006-12-15

Java 6

Sun was nice enough to send me email announcing the release of Java SE 6 on Tuesday. Java 6 is not as exciting as Java 5, but there are a few things to get excited about right off the bat:

  • Integrated web services: JAX-WS is a new API for XML-based web services. JAXB 2.0 is included.

  • Scripting language support, with JavaScript support built-in

  • Enhanced management and serviceability to make profiling and memory leak debugging easier

  • JDBC 4.0 (JSR 221)

If you don't want to spend 27 minutes watching the WebEx Java 6 announcement, here's a summary:

  • Java 6 is free (libre, not just gratis); it is not just open source with a restrictive license. The new license is GPLv2, with a classpath exception that allows you to build commercial closed-source applications. The tools you need to build and run Java 6 applications (javac, hotspot vm, javahelp) are now completely compatible with Linux and other open source projects

  • Java 6 is defined in JSR 270.

  • The Hotspot JVM and core library include performance improvements that make them run significantly faster. One of the improvements involves GC scaling and parallelism.

  • You can now use the Java Monitoring and Management Console to attach to a JVM that is already running. (Does this mean we don't need tools like JProbe and Your Kit Java Profiler?)

  • There are improvements to Swing that improve an application's native look and feel.

  • Building and deploying XML-based web services is a lot easier. All you have to do in your code is add the right annotation, and your class can be made available as a web service or use a web service. They also included JAXB 2.0, my favorite way to convert between XML documents and Java objects. SOAP 1.2 support adds .NET compatibility

  • There are additional rich client development improvement to make a Java desktop application behave like a native app, with easy access to the platform's native security services and default helper applications.

  • JDBC4 adds XML as a SQL data type.

  • JavaDB is included. Based on Apache Derby, it is fee to use and deploy.

  • There is now support for scripting and dynamic languages. Java 6 includes JavaScript support and ships with the Mozilla Rhino JavaScript engine. There is a new framework to integration with other scripting languages and to dynamically generate code.

  • Compatibility across platforms and with previous releases continues to be excellent.

  • One early adopter observes 25%-30% performance improvements.

Based solely on the promise of better performance, it's time to download Java 6 and try it out.

2006-12-13

MySQL hints

Here are the three most important things to get you through your MySQL day:

Invoking the mysql client: The basic syntax to invoke the client, login, and connect to a database is:

mysql -u username -p database_name

or

mysql -u username --password=yourPassword databaseName

For example:

$ mysql -u timmy --password=likesbikes bikes
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 573844 to server version: 5.0.19-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

Getting the list of tables: If you don't already know the schema, you'll start by using show tables to get the list of tables:

mysql> show tables;
+---------------------------+
| Tables_in_bikes |
+---------------------------+
| foo |
| bar |
| baz |
+---------------------------+
3 rows in set (0.00 sec)

Individual table information: Finally, you'll use describe articles to find out about the names, data types, and other information about the columns in a table:

mysql> describe foo;
+--------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+--------------+------+-----+---------+----------------+
| id | bigint(20) | NO | PRI | | auto_increment |
| source_url | varchar(255) | YES | | | |
| title | varchar(255) | YES | | | |
| foo_date | date | YES | | | |
| author | varchar(255) | YES | | | |
| body | text | YES | | | |
| release_date | date | YES | | | |
| summary | text | YES | | | |
+--------------+--------------+------+-----+---------+----------------+
8 rows in set (0.00 sec)

mysql>

2006-12-12

Cool Running

I started running after 15 years of almost exclusively cycling.

I like to log my fitness activities. I built a web app that I used to use to log my cycling. Rather than generalize it for running, I now use the Cool Running Log. It does a great job helping me track my weekly mileage and how many miles I am putting on my shoes.

Another excellent Cool Running resource is this table of what to wear at different temperatures. It's like my clothing guide for cyclists, but reminds me that runners don't have to dress as warmly as cyclists.

2006-12-11

GAIM and MSN conferencing

GAIM is great. IM conferencing is really useful. But it's difficult to remember how to initiate a conference on MSN in GAIM. From the GAIM FAQ, here's how:

Is there a way to invite more than one person to an MSN chat?

Yes. Right click a buddy on your list and choose "Initiate Chat". In the conversation window that appears, choose "Invite" from the "Conversation" menu to invite another user. When the conversation framework gets another rewrite, it is possible that this will be simplified.

2006-11-14

MLS Cup 2006

You know we love New England!
We do! We do!
Cuz we're the Revolution.
The red, the white, the blue!
La la la la, la la,
You know we love New England!
La la, la la,
The red, the white, the blue!

Jake and I had a great time supporting the Revs at the MLS Cup on Sunday. We were overjoyed by their goal late in extra time, only to be disappointed as they let the tying goal throuhg and lost on PKs, 4-3.

Jay, it's not your fault. You had a great season. We look forward to seeing you again in the spring.

2006-11-07

Week 10 practice plan

This week, the sun sets very early, so training sessions will be short. We'll have time for only three or four activities, which will cover fundamentals:

  1. Passing and juggling

  2. 1v1+2

  3. 2v2+2 or 3v3+3

  4. 8v8

2006-11-03

ThinkPad keyboard and the Windows key

I was frustrated that there wasn't an easy way to lock the screen on my ThinkPad G40 running Windows XP. According to Microsoft, you press Windows Key + L to lock the screen. But the ThinkPad doesn't have a Windows key.

Then I found the ThinkPad Keyboard Customizer Utility for Windows XP. I installed it, as well as its required additional packages: ThinkPad HotKey Driver and ThinkPad Power Management Driver. To complete the installation of each utility, I ran the setup programs. For example, to install the Keyboard Customizer, I clicked Start / Run, and typed C:\DRIVERS\WIN\KEYCUSTM\SETUP in the Open box, and clicked OK. After installing all three utilities, I rebooted Windows.

After rebooting, I selected Start / All Programs / ThinkVantage / Keyboard Customizer Utility. The Keyboard Customizer screen appeared:

It showed that the Right Alt Key is mapped to the Windows Key. I selected Enable key assignments and clicked Apply, and I had a working Windows key. I pressed Right Alt + L to lock the screen, and it worked.

2006-11-02

Week 9 practice plan

Back to basics: ball skills, 1v1, possession (large numbers vs. small numbers), bring the ball wide, and a little bit of goal keeper practice.

  1. Passing and juggling

  2. Shield-steal

  3. 1v1+2: Like our old right angle passing game

  4. 2v2+2 or 3v3+3

  5. Four small goals

  6. Triangle goal game

  7. 8v8

2006-10-31

Directions to Lincoln Field #1, Lexington

Here are the directions to our field in Lexington, courtesy of the Lexington coach:

Directions are as follows:

- Rte 2 (West) to Rte. 128 (North)
- Take first exit Rte 2A East Lexington on to Marrett Rd. (Rte 2A - East)
- After 1/3 mile, take a left on Lincoln St.
- Take Lincoln for a mile and the fields are on your right. Lincoln 1 is the field on your left as you enter the main parking lot.

2006-10-24

Manipulating PDF files with Multivalent

I had a contract that I needed to sign and fax to someone, but I don't have a fax machine at home. Instead, I printed and signed the signature page, scanned it, merged it back into the contract in the right place, and send it via email as a PDF file. Here's how I did it.

Multivalent is an excellent Java toolkit for manipulating PDFs. I downloaded Multivalent20060102.jar from http://multivalent.sourceforge.net/download.html, which has a hyperlink to the SourceForge download page, saving the jar file to c:/opt/multivalent. The two Multivalent tools I used were Split and Merge.

Using OpenOffice, I saved the document as a PDF. I split the file into two parts, omitting page 5, the signature page:

$ java -version
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
$ java -cp c:/opt/multivalent/Multivalent20060102.jar tool.pdf.Split -page 1-4 contract.pdf
$ mv contract-x.pdf pp1-4.pdf
$ java -cp c:/opt/multivalent/Multivalent20060102.jar tool.pdf.Split -page 6 contract.pdf
$ mv contract-x.pdf p6.pdf

I printed, signed, and scanned the signature page, and saved as p5.pdf. Then I merged the contract back together:

$ java -cp c:/opt/multivalent/Multivalent20060102.jar tool.pdf.Merge pp1-4.pdf p5.pdf p6.pdf
copy pp1-4.pdf
+ p5.pdf
+ p6.pdf
$ mv pp1-4-m.pdf contract-signed.pdf

It was all set, and I emailed it away.

Update of 2008-11-12: PDF Split and Merge is a GUI-based tool that does the same thing.

Week 8 practice plan

This week's practice plan is the same as last week's: warm up, play small-sided games, and finish with a plain old scrimmage. This is a good practice plan because it's simple and it encourages fast decision making. We'll continue to emphasize passing, especially passes toward the sidelines and switching field.

2006-10-17

Week 7 practice plan

Here is an outline for this week's training. The goal is to reinforce the value of passing, especially away from the center of the field, and to encourage switching the field.

  1. Passing and juggling: Warm up in pairs. Encourage long passes.

  2. 1v1

  3. 1v1+1

  4. 1v1+2: Neutral players play on the side line to encourage passes to the outside. Award extra points for switching field.

  5. 2v2+2 or 3v3+3

  6. 8v8: Extra points for "switch field."

In small sided games, continue to show the defensive wall.

2006-10-13

Oportunistic Software Quality

In 2000, I presented a paper titled Opportunistic Software Quality at the 13th International Software / Internet Quality Week in San Francisco. Here it is, in my continuing hope that someone will find my old publications useful.

2006-10-12

How to add an icon to your web site

I wanted to add a mug shot of myself as this web site's icon. To create the icon, I started with an 8 megapixel photograph of myself that I had used for an ID card. Using the GIMP, I cropped it into a 2150x2150 pixel square, just barely chopping off the top of my head and the bottom of my chin. Then I scaled the image down to a 16x16 pixel square and made the background transparent. I saved it as favicon.ico, with these icon details: 4bpp, 1-bit alpha, 16-slot palette. I copied the file to the root directory of my web site's local staging area, applied chmod a+r to it, and uploaded it to the server.

My web server is Apache 2.0.54. To make Apache serve the icon with the right MIME type, I added this line to /etc/httpd/conf/httpd.conf:

AddType image/x-icon    .ico

To make my web browser load the icon, I cleared the browser's cache, visited the web site, and marveled as my tiny mug shot appeared in the browser tab.

Here are some of the resources I consulted:

Directions to Downs Field (5A), Brookline

Here are directions to Downs Field (5A), Brookline, courtesy of the Brookline coach:

Game time is 1:30PM. The field has changed from the original BAYS listing. We will be playing on a synthetic surface at Downes Field (5A). Directions @ http://www.brooklinesoccer.org/fields.htm

2006-10-11

Build Better Java Applications

In 2000, my friend Spencer Marks and I summarized some best practices for building Java applications in a presentation that Spencer presented at Software and Internet Quality Week Europe in Brussels. We would have presented it together, but I was in the room next door giving another presentation. Here are our slides, Building Better Java Applications, and here is fresh criticism of some of the points we made, based on six more years of experience building Java-based applications:

  • Best practice: UML: Together/J is now Borland's Together. I used the high end version of Together for a few years, and it completely changed the way I developed software applications. The aggregate set of tools in Together made me look smart. Unfortunately, it was very expensive, and it was too difficult to convince my subsequent employer to pay for it, so I stopped using it. I still haven't found a better overall design tool, although some of the tools in IntelliJ IDEA cane make you look just as smart.

  • Best practice: Jikes: I still admire Jikes' adherence to the Java Language Specification. With the advent of ant, some of the other arguments (fast compile time and cross-platform builds) don't hold up as well.

  • Best practice: Builds: make never was a good way to build Java applications. Ant is great for cross-platform builds. Some of my friends advocate Maven for large projects.

  • Best practice: Check in often: This should be called "Integrate early and often." I now use subversion; it is clearly better than CVS.

  • Best practice: Standard library: This could be expanded to a diatribe against the antipattern, "Build all your own infrastructure." Jakarta Commons contains many of the tools application programmers need every day.

  • Best practice: Java idioms: In the Java 5 era, the idioms are a little different. We like for loops again—foreach is the best way to iterate over a Collection. Generics are great for type safety—use them! Just by adding generics to your legacy code, you'll find and fix lots of bugs. java.util.concurrent is great if you need low level synchronization—don't roll your own!

  • Methodology: Refactor often: Today, tools like Eclipse make refactoring easy and painless. I don't know how we got any work done without it.

2006-10-10

Week 6 practice plan

Here is an outline for this week's training. The goal is for the players to continue improving basic skills, especially the possession game. We'll review throw ins and introduce the defensive wall.

  1. Passing and juggling: Warm up in pairs

  2. Throw in wall pass: Player stands at first cone, throws the ball in to his partner, and runs to the second cone, where he receives a pass from his partner. Partner practices ball skills receiving the throw in and attempts to pass back with 1 or 2 touches.

  3. Shield-steal

  4. Right angle passing

  5. 2v2+2 or 3v3+3

  6. Four small goals

  7. Triangle Goal Game

  8. 8v8

Encourage possession (stealing, shielding, passing) and shooting from distance. In small sided games, teach the use of a defensive wall to block a free kick.

J2ME provisioning

In 2004, Boston Mobile hosted a comparison of BREW and J2ME, focused on mobile application provisioning. Here is the presentation I gave on J2ME provisioning.

2006-10-06

J2ME Fundamentals

In 2003, Altisimo built a day-long J2ME training course called J2ME Fundamentals. It's a little outdated, but it's always good to share, so here it is.

Accented characters, Dvorak, and Windows XP

Windows XP has a US-Dvorak keyboard layout, which I use, and a US-international layout that makes it easy to type accented characters like the é in résumé, but it doesn't have a US-Dvorak-international layout that combines the two. Fortunately, someone solved the problem. You can download the "Dvorak International Extended Keyboard Layout" here.

(Of course, when you're posting HTML, don't forget to use é for é, otherwise it might not look right in all applications and on all platforms.)

2006-10-05

Java ME articles

Way back in 2003 and 2004, I was doing a lot of work with J2ME, now known as Java ME. I coauthored a few articles to help people get started developing Java ME applications:

Directions to Leary Field, Acton

Here are directions to Leary Field in Acton, courtesy of the A-B coach:

directions from our web site are a bit misleading The field is located behind the Acton/Boxborough R.J Grey Jr High Take Rt 2 West Through the Concord Rotary (just past the State Police Barracks and MA Correctional Facility) staying on Rt 2, you will go through a traffic light and then take a left exit onto Rt 111 Mass Ave

Follow Straight, after passing through one traffic light the school campus is on your right. Turn right (Charter Rd) just before the tennis courts. The Jr High is the first building on your left. The field is behind it. There is limited parking close to the field but there are lots all along the Jr High on the left.

Leary Field is a new artificial turf field. Please NO FOOD OR SPORTS DRINKS on the field. Water is fine. No cleats on the track use the rubber nats to cross over. There is a bleachers section and some grass areas that can be used for halftime break/snack. Spectators should be in the bleachers.

2006-09-26

Week 4 practice plan

Here is an outline for week 4 training. The goal is for the players to continue improving ball handling, speed in tight spaces, possession, and shooting.

  1. Passing and juggling: Warm up in pairs

  2. One touch: Four players, two tossing the ball and two returning it to the tosser with a particular body part. After returning the ball, quickly switch to the other tosser. Body parts to use follow this sequence: right foot, left foot, right thigh, left thigh, chest, head.

  3. Shield-steal

  4. Tag: Every child dribbles a soccer ball in the space defined while trying to tag other players with their hand. Players cannot leave their own ball. Have them keep count of how many people they have tagged and, if playing twice in a row, see if players can tag more people than they did in the first game. Version 2: Players must tag other players on their knees.

  5. 2v2+2 or 3v3+3

  6. Four-squares passing

  7. Triangle Goal Game

  8. 8v8 wide: Wide field with two goals in opposite corners to encourage spreading the field wide and making crossing passes.

For small sided games, encourage possession (a certain number of consecutive passes before shooting) and shooting from distance.

2006-09-25

ActiveSync error 80141003

I tried to synchronize my Contacts from my PocketPC with ActiveSync 3.7.1, but ActiveSync displayed a window like this:


The following contact cannot be written to Microsoft Outlook due to error 80141003. The item will be skipped.
Firstname Lastname" height="364" width="462">

I had added a URL to the contact's Notes field. The solution is to remove the URL and resynchronize.

Martial arts stores

Two nearby martial arts stores are:

  • Dragon Connections is on Moody Street in Waltham, across the street from New Mother India. The day I visited, the woman running the store was also taking care of her four year old and baby. She was very friendly and helpful, letting me try various products and sizes. I found exactly what I was looking for. Based on my one visit, I recommend this store.

  • Silky Way is at 38 Kneeland Street, near Harrison Avenue in Chinatown. It was closed the day I visited. A friend recommends it.

Florida vacation

Ah, Florida, a great place to vacation during hurricane season, especially if your travel and lodging are free. I redeemed my soon-to-expire airline voucher, my generous aunt and uncle gave me their vacation home for a long weekend, and Jake and I took off for some fun.

Day 1
Our 3.5 hour direct flight from Boston to Fort Meyers grew into a 10 hour odyssey of cancellations, connections, and lost luggage. I looked up driving directions on my PDA and read them to our map-challenged limo driver (no taxis, only limos here). Tired and hungry, we ate at Marsala Pizza in the Bonita Grande Crossing mini-mall. My personal size Margherita pizza and Jake's spaghetti and veal dinner hit the spot before we hit our beds.

Day 2
We started the day at Target on US-41, a good place to buy a day's worth of replacement clothes for Jake. From there, we headed for Sanibel, a short drive north along the beach roads.

We paid a $6 toll to cross bridge, and headed for the Ding Darling National Wildlife Refuge, where we powered up on the subs we had bought at the Albertsons grocery store near Target. $30 got us a rented kayak. We paddled along the marked kayak trail, upstream and into a gentle headwind on the return half of the trip, and rewarded ourselves with ice cream bars at the gift shop.

The locals recommend Bowman's Beach for shell collecting, and t didn't let us down. After two hours of shelling, swimming, and repeatedly covering myself in sunblock ("Look, ma, no sunburn!"), we were ready to move on.

"Hi, I'm Michael, and I'm your Bubble Scout tonight." I thought I must have made a mistake. The Bubble Room on Captiva seemed like good advice until I saw the prices on the menu. I resigned myself to getting ripped off, only to be thrilled with the high quality and large portions.

We skipped desert, watched the sunset from one of Sanibel's beaches, and headed home.

Day 3
There was a space shuttle launch scheduled for Day 4. Our plan was to visit Kennedy Space Center the day before the launch, stay overnight at a nearby hotel, and, if we got lucky and the launch took place, watch the launch. The Visitor Center is closed on launch days, so arriving a day early was the only way to guarantee that we would get in. After a four hour drive and about $15 in tolls, we arrived at the Visitor Center. We paid $38 each for "Maximum Access" tickets, which include entry to the Astronaut Hall of Fame. We enjoyed the tour and saw Atlantis on the launch pad for the observation tower.

The Astronaut Hall of Fame's style was a nice contrast to the Visitor Center, which is mostly look-but-don't-touch. Most of the exhibits were interactive, including a high-G-force hurl-a-whirl. We didn't feel like waiting in line for an hour—no exaggeration—but the people who rode it looked like they had a good time.

Day 4
It was a late night driving back from Kennedy Space Center, so today was our rest day. Late in the afternoon, we spent some time in the pool at the Fitness Center.

Day 5
We drove south to the Everglades City visitor center in Everglades National Park. We arrived just in time to watch the park rangers locking everything down—they had closed the entire park as we were driving. Hurricane Ernesto was approaching, and the park's new policy was to shut down a full day before a hurricane's predicted landfall.

Determined to enjoy ourselves, we headed for Captain Doug's Small Airboat Tours. We paid $35 for me and $17.50 for Jake, and Captain Glen took us for a ride. Captain Glen piloted us through the mangroves and showed us the "wild" animals: a raccoon, a group of pigs, and a really big gator. The animals aren't exactly wild; they are well trained to know that airboat captains bring food.

We returned to Bonita Springs and spent the afternoon at Barefoot Beach.

Day 6
We spent the morning cleaning up the apartment, and called a taxi for a ride to the airport. Our Delta/Song flight had personal entertainment systems on each seat back. A nearby system kept rebooting, and I noticed that it ran Linux. As it booted, Tux appeared in the top left corner of the screen, and the boot sequence announced that it was running Red Hat something.

2006-09-22

Code churn and defect density

As a software producer, your goal is to deliver a high quality product to your customers. As you approach your release date, you want your product to have a known quality level. The released product will contain bugs. Your team's goal is to find as many bugs as possible, fixing the most important ones before the release date, listing the less important ones in the product documentation and fixing them later.

That last step is bug triage. You need to classify the known bugs into two categories: the ones that are important to fix, and the ones you can live with. Every bug fix is a code change, and every code change can introduce a new bug, so you want to limit the number of bug fixes. You don't want to accidentally introduce new bugs that you don't have time to find and fix before the release date.

Here is a quick survey of articles and literature on the topics of bug triage, code churn, and defect density:

  • The politics of bug fixing discusses bug triage and the political games that take place as people lobby to get their favorite bugs fixed.

  • My life as a Code Economist is a great overview on the subject. It gives bug triage advice and includes the quote, "Every time you fix a bug, you risk introducing another one.".

  • Use of Relative Code Churn Measures to Preduct System Defect Density (avalaible to ACM Digital Library subscribers) reaches these conclusions:

    • Increase in relative code churn measures is accompanied by an increase in system defect density;

    • Using relative values of code churn predictors is better than using absolute values to explain the system defect density;

    • Relative code churn measures can be used as efficient predictors of system defect density; and

    • Relative code churn measures can be used to discriminate between fault and not fault-prone binaries.

  • Where the Bugs Are (ACM) starts with the assumption that being able to preduct which modules contains bugs is an important contributor to the efficiency of the test team.

2006-09-21

Directions to Belmont Field 3A

Here are directions to Belmont Field 3A, courtesy of the Belmont coach:

Hello Richard, yes 2:30pm at the field on concord ave, please see this link...

http://www.belmontsoccer.com/

the field is 3A, passing the belmont high school on your right continue down concord ave, it is after the football field, just after the hockey rink, before the baseball field (all on your right) if you pass the mobile gas station (also on your right) you've gone too far.

Here is a map, and here are the directions on the Belmont Soccer web site.

2006-09-18

Intenational Talk Like a Pirate Day

Pirate Day badge

Avast! Language Log reminded me that tomorrow is International Talk Like a Pirate Day! Arrr, Cambridge soccer is off the port side, and we will hold a Pirates training session tomorrow, like usual.

2006-09-16

Week 3 practice plan

Here is an outline for week 3 training. The goal is for the players to continue improving their skills.

  1. Passing and juggling: Warm up in pairs

  2. One touch: Four players, two tossing the ball and two returning it to the tosser with a particular body part. After returning the ball, quickly switch to the other tosser. Body parts to use follow this sequence: right foot, left foot, right thigh, left thigh, chest, head.

  3. Speed dribble: Players line up on any side of a square. Players dribble across the square and back as many times as possible within 60 seconds. The player that goes across the square the most times wins.

  4. 2v2+2 or 3v3+3

  5. Four-squares passing

  6. Four Small Goals

  7. Triange Goal Game: Make a triangle with three cones in the center if the field. The sides of the triangle each serve as a goal mouth so teams can shoot at three different goals. Place 2 goalies in the triangle and the 2 goalies must protect the three goal mouths. Two even teams play a normal soccer game, except they both can score on any of the three faces of the triangle for a point. The game is continuous and if a goalie catches the ball he just throws it out so the game continues. Version 2: Use two balls at the same time.

  8. 8v8 wide: Wide field with two goals in opposite corners to encourage spreading the field wide and making crossing passes.

For small sided games, award extra points for each successful wall pass, or require wall passes before shooting on goal.

Directions to Cutting Field, Sudbury

Here are directions to Cutting Field in Sudbury, courtesy of the Sudbury coach:

The web link is
http://www.sudburysoccer.org/directions.htm

the directions with out the map are:

Cutting Field

Directions: From Rte. 128 take Rte. 20 west to Wayland Center. Turn right at the lights onto Rte. 27, heading to Sudbury Center. A bit more than three miles later you will pass Sudbury's main fire station. At that point the road forks. Veer right to stay on Rte. 27, which becomes Maynard Road. Continue on Maynard Road for approximately 2 miles. Cutting Field, with its artificial surface, is easy to spot on your left, just past Wyman Drive and about 100 yards before the Maynard line. Parking is available in a lot behind the field.

The field is turf, cleats or turf shoes are fine.

2006-09-12

How to run Tomcat automatically

To configure Linux to run Tomcat automatically at boot up, follow these steps.

First, note where you installed Java and Tomcat. My JAVA_HOME is /usr/java/jdk1.5.0, and my CATALINA_HOME is /opt/apache-tomcat. Specify these directory names in the tomcat script that you create.

Login as the tomcat user and create a script in directory $CATALINA_HOME/bin named tomcat. The script contains this text:

:
# Starts and stops Tomcat.
# Richard Kasperowski
# 2006-09-12

export JAVA_HOME=/usr/java/jdk1.5.0
export CATALINA_HOME=/opt/apache-tomcat

cd $CATALINA_HOME/bin

case "$1" in
start)
echo -n "Starting tomcat: "
su tomcat -c "./catalina.sh start"
retval=$?
echo
;;

stop)
echo -n "Shutting down tomcat: "
su tomcat -c "./catalina.sh stop"
retval=$?
echo
;;

restart)
$0 stop
$0 start
retval=$?
;;

*)
echo "Usage: tomcat {start|stop|restart}"
exit 1
esac

exit $retval

Make the script executable:

$ chmod +x tomcat

Create links from /etc/init.d and /etc/rc.d to the new script:

$ sudo ln -s /opt/apache-tomcat/bin/tomcat /etc/init.d/tomcat
$ sudo ln -s /etc/init.d/tomcat /etc/rc3.d/S99tomcat
$ sudo ln -s /etc/init.d/tomcat /etc/rc3.d/K99tomcat

Test the links:

$ sudo /etc/init.d/tomcat stop
Shutting down tomcat: Using CATALINA_BASE: /opt/apache-tomcat
Using CATALINA_HOME: /opt/apache-tomcat
Using CATALINA_TMPDIR: /opt/apache-tomcat/temp
Using JRE_HOME: /usr/java/jdk1.5.0

$ sudo /etc/init.d/tomcat start
Starting tomcat: Using CATALINA_BASE: /opt/apache-tomcat
Using CATALINA_HOME: /opt/apache-tomcat
Using CATALINA_TMPDIR: /opt/apache-tomcat/temp
Using JRE_HOME: /usr/java/jdk1.5.0

$ sudo /etc/rc3.d/K99tomcat stop
Shutting down tomcat: Using CATALINA_BASE: /opt/apache-tomcat
Using CATALINA_HOME: /opt/apache-tomcat
Using CATALINA_TMPDIR: /opt/apache-tomcat/temp
Using JRE_HOME: /usr/java/jdk1.5.0

$ sudo /etc/rc3.d/S99tomcat start
Starting tomcat: Using CATALINA_BASE: /opt/apache-tomcat
Using CATALINA_HOME: /opt/apache-tomcat
Using CATALINA_TMPDIR: /opt/apache-tomcat/temp
Using JRE_HOME: /usr/java/jdk1.5.0

$

If that all worked, you succeeded.

Resources:
The script was adapted from webMathematica configuration instructions.

2006-09-10

Fall 2006 schedule

Oct. 31 update: note the new date and time for the Week 8 game vs. Belmont.

Here is the Cambridge Pirates BAYS U14B game schedule for Fall 2006:

Week

Date

Opponent

Location

Time

Directions

1

Sep 9

Brookline

Danehy 2

1:00

Danehy Park

2

Sep 16

Sudbury

Sudbury CU

2:30

Cutting Field

3

Sep 23

Belmont

Belmont 3A

2:30

Field 3A

4

Sep 30

Lexington

Danehy 4

2:30

Danehy Park

5

Oct 7

Acton-Boxborough

A-B 14

2:30

Leary Field

6

Oct 14

Brookline

Downs Field (5A)

1:30

Downs Field (5A)

7

Oct 21

Sudbury

Danehy 4

2:30

Danehy Park

8

Nov 12 (was Oct 28)

Belmont

Danehy 4

12:00

Danehy Park

9

Nov 4

Lexington

Lexington 1

3:00

Lexington 1

10

Nov 11

Acton-Boxborough

Danehy 4

2:30

Danehy Park

Our home games are on the artificial turf field, and Lexington also has artificial turf, so it is unlikely that any of the home games or the Lexington game will be postponed due to bad weather. For home games, call the Danehy Park hot line at 617-349-4895 to see whether the field is open. For away games, Ed or I will send email announcing a postponed game.

Please be at all games 30 minutes before the scheduled start time, prepared and ready to warm up and play. Being prepared includes:

  • Wearing all equipment, including uniform, shin guards, and shoes

  • Not wearing any jewelry, necklaces, or bracelets

  • Ready to warm up

  • Brought your own drink and snack

For away games, Ed or I will coordinate with the opposing coach to verify the time and location and to get driving directions. We will send an update by email before each away game.

2006-09-09

Week 2 practice plan

Here is an outline for week 2 training. The goals are for the coaches to continue getting to know the players, and for the players to begin improving their skills.

  1. Passing and juggling: Warm up in pairs or small groups

  2. One touch: Toss the ball to your partner, and he returns it to you with a particular body part. Body parts to use follow this sequence: right foot, left foot, right thigh, left thigh, chest, head.

  3. 2v2+2 or 3v3+3

  4. 5 Goal Game: 4v4+2; or N+1 goal game, with NvN+2, where N is the number of players per side. Add: make a certain number of passes before shooting, then turn it into Gates Passing.

  5. Four-squares passing

  6. Four Small Goals: Conditions to add include: make a certain number of passes before shooting; shoot from farther away.

  7. Triange Goal Game: Make a triangle with three cones in the center if the field. The sides of the triangle each serve as a goal mouth so teams can shoot at three different goals. Place 2 goalies in the triangle and the 2 goalies must protect the three goal mouths. Two even teams play a normal soccer game, except they both can score on any of the three faces of the triangle for a point. The game is continuous and if a goalie catches the ball he just throws it out so the game continues. Version 2: Use two balls at the same time.

  8. 8v8: Two goals. Start with goals in opposite corners to encourage spreading the field wide and making crossing passes.

Resource: Massachusetts Youth Soccer U6-U12 Curriculum

How to remove comments from Roller 2.0-incubating

It's easy to prohibit people from adding comments to blog entries, but Roller 2.0 doesn't make it easy to delete them. Here's how I do it.

I installed Tomcat under /opt/apache-tomcat, which I'll call TOMCAT_HOME, and I installed Roller under TOMCAT_HOME/webapps/blog, which I'll call ROLLER_HOME. When I installed Roller, I used file ROLLER_HOME/WEB-INF/dbscripts/mysql/createdb.sql to create the MySQL database schema. In this file, I find:

create table roller_comment (
...

This looks like the table from which I will delete rows. Now I need to remember my MySQL username and passwsord for Roller. File TOMCAT_HOME/conf/Catalina/localhost/blog.xml contains this entry, in which I tell Roller my MySQL credentials:

 driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/roller?autoReconnect=true&useUnicode=true
&characterEncoding=utf-8&mysqlEncoding=utf8"
username="MyRollerUser"
password="MyRollerPass"
maxActive="20"
maxIdle="3"
removeAbandoned="true"
maxWait="3000" />

Then I log in to MySQL:

$ mysql roller -h localhost -u MyRollerUser -pMyRollerPass
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 111 to server version: 4.1.20

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

To see all the comments, I type:

mysql> select * from roller_comment;
...
11 rows in set (0.00 sec)

mysql>

In this case, the only comment worth keeping has id ff808081084877d1010c56353ddc02c4. I test a WHERE clause that I will use to delete all the other comments:

mysql> select * from roller_comment where id != 'ff808081084877d1010c56353ddc02c4';
...
10 rows in set (0.00 sec)

mysql>

The result is correct, so I delete the offensive comments and verify the result:

mysql> delete from roller_comment where id != 'ff808081084877d1010c56353ddc02c4';
Query OK, 10 rows affected (0.00 sec)

mysql> select * from roller_comment;
...
1 row in set (0.00 sec)

mysql>

All done. Now I can share my blog with the kids again.

2006-09-06

How to hide comments in Roller

Someone defeated my Roller-based blog's amazingly difficult CAPTCHA (e.g., "What is 3 + 4?") and posted some embarrassing spam comments. I needed a quick way to hide them. In Settings, Preferences/Templates, I edited my _day template by commenting out #showCommentsPageLink( $entry ). My _day template now looks like this:


#showDayPermalink( $day )
#showEntryDate( $day )


#foreach( $entry in $entries )



$entry.title
#showEntryText($entry)
$text.get("macro.weblog.postedby") $entry.creator.userName
(#showTimestamp($entry.pubTime))
#showEntryPermalink( $entry )


#end

#showLinkbacks( $day )

This almost does what I want: now, no one can add new comments. It's not obvious how to prevent comments from being displayed, though. There are two things I still need to do: 1) Quickly delete the comments from the database using the MySQL command line, and 2) Upgrade to Roller 2.3, which is available on the Roller download page. According to the user guide, Roller 2.3 has better comment management and spam handling.

2006-09-03

Week 1 practice plan

Here is an outline for week 1 training. The goals are to get to know each other and review U12 skills.

  1. Passing and juggling: Warm up in pairs or small groups

  2. Colors passing: Half of the players in red pennies, half in blue. Teams playing together in the same space combine in the passing sequence blue-blue-red-red-blue-blue-red-red etc. etc. Ball can never stop, players can never stop moving, and ball cannot leave area of play. Coach can limit touch-count, mandate which foot to pass with or which side of foot to pass with as sees fit. When players can do first sequence adequately and without frequent errors change the sequence to blue-blue-blue-red-red-red-blue-blue-blue etc. etc. Stress communication and technical passing points throughout. Make this activity competitive by counting errors and setting goals by lowering allowed errors.

  3. Shield-steal

  4. 2v2+2 or 3v3+3

  5. 5 Goal Game: 4v4+2; or N+1 goal game, with NvN+2, where N is the number of players per side

  6. Four-squares passing

  7. Four Small Goals

  8. 8v8: two goals

Resource: Massachusetts Youth Soccer U6-U12 Curriculum

2006-08-09

Who's your father?

Here's another soccer song, sung at tonight's Revolution match after a particularly bad call:

Who's your father?
Who's your father?
Who's your father, referee?
You don't have one, never had one.
You're a [bad guy], referee.

2006-07-25

SpamArrest

I have been using the same email address since 1997. I used to run a small software development consulting company; I needed my email address to be well publiclicized so people could find and hire me. The unintended result is that my email address is a spam target--I get so much spam that the mailbox would be unusable if I didn't have a good tool to help me.

The best tool I have found to cope with spam is to make the sender prove he is human. I use SpamArrest (yes, that's an affiliate link, and I get a small referral bonus if you sign up), and the results are amazing. The downside is that the first time someone sends me email, he has to pass a CAPTCHA. The upside is that I hardly ever receive spam in my filtered mailbox. Given the results, forcing people to pass a CAPTCHA is a fair trade.

I have used SpamArrest since 2004, and the results have been amazing:

Messages Processed       147943
Messages Forwarded 19293
Spam Percentage 86.96%

That's right, 87% of the email I receive is spam. Here are some charts showing the results. The first chart shows the same breakdown between spam and non-spam since I began using SpamArrest:

Pie chart of all email processed

These charts show results for the last 30 days:

Pie chart of all email processed Pie chart of all email processed

The results speak for themselves. SpamArrest works for me, and my email box remains usable.

2006-07-23

Revolution vs. Celtic FC

I saw the New England Revolution play Celtic FC Wednesday night at Gillette Stadium in Foxborough with my friends Andrew and Simon. I accidentally asked for the "$25 seats" instead of "tickets for the Fort," and ended up with seats on the north side of the stadium. We had a clear view of the Fort from there, and it was great to discover that you can hear the nice folks in the Fort everywhere in the stadium.

We met a friendly guy from Scotland, something that wouldn't have happened if we had sat in the Fort. He said he was a lower division player in Scotland who had suffered a major foot injury. His team forced him to take a year off, and he was spending it in the States working as a youth soccer coach at training camps run by MLS. He was excited to see Stevie Nicol coaching. His father is a Celtic season ticket holder, and he filled me in on some of Celtic's background. The team is from Glasgow. The club has an Irish theme and legions Irish and Irish-American supporters because it was founded by Irish monks. Four players from World Cup teams were absent, taking some time off between the Cup and the beginning of Scotland's season.

In the first half, both sides' A teams played to a 0-0 draw. Each side made a number of substitutions in the second half, and the B teams played to a 1-1 final score. Admittedly, the Rev's are in midseason form and Celtic has barely begun training, but it looked like this MLS team was very competitive with this year's Scottish league champs.

I sang to myself on the way out, and I haven't gotten the song out of my head since the match:

We're all part of Nicol's army,
We're all out to win the League!
And we'll really shake 'em up
When we win the [flipping] Cup!
Cause New England has the greatest football team!

(Words adapted from http://www.bigsoccer.com/forum/showthread.php?t=364733)

2006-07-19

How to remove a stale shortcut

Once in a while, a program installed on my HP iPAQ 6315 becomes stale. Some of its files disappear, and it won't run any more. The program's icon still appears in the Windows Mobile Programs list, though. When you select it, Windows displays a message like this:

Foo.exe                   ok
Cannot find 'Foo'
(or one of its components)
. Make sure the path and
filename are correct and all
the required libraries are
available.

I don't need the program any more, so I don't care that it doesn't run, but I do want to remove it from the Programs list. Here's how:

First, run ActiveSync.

ActiveSync

Click Explore. Under My Pocket PC, browse to \Windows\Start Menu\Programs:

Mobile Device explorer

Select the stale shortcut, and click Delete this item.

2006-07-14

Apache RedirectMatch

My web site's front page was stale and ugly. It was time for a makeover, but I am not much of a web site beautifier. I thought this blog might be a good entry point, but it was already installed under /blog/page/kasper/. I thought it would be too hard, and probably a bad idea, to make the blog run directly under /, but I still wanted / to point to the blog.

The first thing I tried was the refresh meta tag. I added this line to my /index.html:

<meta http-equiv="refresh"
content="0;url=http://kasperowski.com/blog/page/kasper/">

That worked--it forwarded to the blog--but it looked amateurish. The web browser displayed the old /index.html file briefly before displaying the blog page--very dissatisfying.

The next thing I tried was Apache Redirect. I added this line to kasperowski.com's VirtualHost entry in the httpd.conf file:

Redirect permanent / http://kasperowski.com/blog/page/kasper/

At first, I thought that worked great. When a web browser requested /, it immediately displayed /blog/page/kasper/. It broke everything else, though. Every page under / was redirected to /blog/page/kasper/. For example, /foo redirected to /blog/page/kasper/foo, which didn't exist.

My final idea was Apache RedirectMatch. I wanted /, and only /, to redirect to the blog, and everything else to behave like usual. I replaced the Redirect line in httpd.conf with:

RedirectMatch permanent ^/$ http://kasperowski.com/blog/page/kasper/

That did exactly what I wanted: / is the only thing that redirected to /blog/page/kasper/. Everything else, like /foo, worked that way it did before.

2006-07-02

Cygwin rxvt

Cygwin is great, but the standard Cygwin Bash Shell shortcut isn't. I need something more powerful than the DOS window. I want something more like an xterm, with easy copy and paste, and a recognized $TERM for emacs and vi sessions.

rxvt gives me what I want. I found this command line somewhere a while ago, and it make rxvt do pretty much what I want:

$ rxvt.exe -sl 1500 -fn "Lucida Console-12" -bg black -fg grey -sr -e bash --login -i

I add a shortcut to C:\cygwin\bin\rxvt.exe on my Windows desktop, and put that command line as the shortcut's target. Now I'm happy.

2006-06-27

Meld

I was looking for a visual diff tool for Linux, and I found Meld. When I change some code and need a quick review before I commit my changes, a visual diff is a lot easier to read than svn diff.

Installing Meld on FC5 was simple:

$ sudo yum install meld

yum installs a launcher under Applications/Programming. I now use Meld frequently, so I added the Meld launcher to the panel.

Meld launcher

When you run Meld, it comes up empty. I wish it would start up with the content it held when I last exited.

Meld empty

That's a minor nit, though, considering how much better Meld is than xxdiff, the tool I used to use for visual diff. Pointing Meld to a subversion-controlled directory is easy enough.

I use the Flatten Modified view, and Meld shows me only the files that I have changed.

Meld Flatten Modified

The Compare button delivers the visual diff. In this example, I have added a line, changed a line, and deleted some lines:

Meld Compare

The final treat is that Meld lets me perform some basic version control. Here, I commit my changes:

Meld VC Log

I wish Meld would let me invoke other version control commands, such as svn log, but it doesn't. All in all, though, Meld exceeded my expectations as a visual diff tool.

2006-04-11

Fedora Core 5 under VMWare 5.5

I gave up on Fedora Core as the base OS on my laptop, but I still need to use Linux for development work. I now am running Fedora Core 5 as a guest OS under VMWare. This works pretty well.

SpeedStep

According to cygwin, the laptop's CPU is:

$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
type : primary processor
cpu family : 6
model : 13
model name : Intel(R) Pentium(R) M processor 2.13GHz
stepping : 8
brand id : 6
cpu count : 0
apic id : 0
cpu MHz : 2128
fpu : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clfl dtes acpi mmx fxsr sse sse2 ss tmi pbe tm2 est

This CPU implements SpeedStep. Its maximum speed is 2.128 GHz, but it usually runs at a lower frequency.

The FC5 guest paused every few seconds, making it virtually unusable. It turns out that this is a known problem with VMWare guests running on SpeedStep-enabled hosts. To solve the problem, I added the following lines to file c:/Documents and Settings/All Users/Application Data/VMware/VMware Workstation/config.ini:

host.cpukHz = 2128000
host.noTSC = TRUE
ptsc.noTSC = TRUE

Now it still pauses ocassionally, but it's completely usable.

vmware-config-tools.pl

The VMWare kernel module is required to get full use of the FC5 guest. Unfortunately, Fedore Core's kernel doesn't match its kernel header files:

$ uname -a
Linux foo 2.6.16-1.2080_FC5 #1 Tue Mar 28 03:38:34 EST 2006 i686 i686
i386 GNU/Linux
$ sudo vmware-config-tools.pl

Stopping VMware Tools services in the virtual machine:
Guest operating system daemon: [ OK ]
Guest filesystem driver: [ OK ]
Trying to find a suitable vmhgfs module for your running kernel.

None of the pre-built vmhgfs modules for VMware Tools is suitable for your running kernel. Do you want this program to try to build the vmhgfs module for your system (you need to have a C compiler installed on your system)? [yes]

Using compiler "/usr/bin/gcc". Use environment variable CC to override.

What is the location of the directory of C header files that match your running kernel? [/usr/src/linux/include] /usr/src/kernels/2.6.16-1.2080_FC5-i686/include
The kernel defined by this directory of header files does not have the same address space size as your running kernel.

What is the location of the directory of C header files that match your running kernel? [/usr/src/linux/include]

It is possible to build the VMWare kernel module without building a kernel from source. Using Red Hat's release notes, a kernel thread on the VMWare forum, and a vmware-config-tools.pl thread on the VMWare forum, I follow these steps:

  1. Clean up stuff from old kernels:

    $ cd /usr/src/redhat/SOURCES
    $ rm -f kernel*
    $ rm -f linux*
    $ rm -f patch*
    $ cd ../SPECS
    $ rm kernel-2.6.spec
    $ cd /usr/src
    $ rm linux
  2. Identify the current kernel version:

    $ uname -r
    2.6.16-1.2080_FC5
  3. Download the kernel-*.src.rpm from http://download.fedora.redhat.com/pub/fedora/linux/core/updates/5/SRPMS/.

  4. Install kernel-*.src.rpm:

    $ sudo rpm -i kernel-2.6.16-1.2080_FC5.src.rpm
  5. Prepare the kernel sources:

    $ cd /usr/src/redhat/SPECS
    $ sudo rpmbuild -bp --target=i686 kernel-2.6.spec

    If you don't have rpmbuild, you can obtain it via:

    $ sudo yum install rpm-build
  6. Link /usr/src/linux to the new source:

    $ sudo ln -s /usr/src/redhat/BUILD/kernel-2.6.16/linux-2.6.16.i686 /usr/src/linux
  7. Name the kernel. Edit Makefile and change the value of EXTRAVERSION:

    $ cd /usr/src/linux
    $ sudo emacs Makefile

    I set mine like this:

    EXTRAVERSION = -1.2080_FC5
  8. Prepare the kernel modules:

    $ sudo make oldconfig
    $ sudo make modules_prepare
  9. Edit vmware-config-tools.pl:

    $ sudo emacs /usr/bin/vmware-config-tools.pl

    Replace these broken lines:

      $header_page_offset =~ s/^$pattern \(?0x([0-9a-fA-F]{8,}).*$/$1/;
    if ($header_page_offset =~ /[0-9a-fA-F]{8,}/) {

    with these fixed ones:

      if ($header_page_offset =~ /^$pattern (\?0x([0-9a-fA-F]{8,}))/) {
    $header_page_offset = $1;
  10. Build the VMWare tools:

    $ sudo vmware-config-tools.pl

This time, vmware-config-tools.pl succeeds, and all is well.

2006-04-07

Giving up: FC4 isn't good enough on Dell Latitude D610

Configuring Fedora Core 4 on the Dell Latitude D610 was simply too time consuming, and many things were too difficult. The last straw was when I needed to give a presentation to a prospective customer. I jumped through the right hoops to get an X server running at the right resolution and scan rate for the projector, but the presentation went poorly because I spent that time fussing with X instead of preparing for the presentation.

I wiped FC4 and installed Windows XP. Now everything just works, including the things that FC4 couldn't do well:

  • Microsoft Exchange client: Evolution is almost, but not quite, an adequate Exchange client. Outlook is just better.

  • WiFi: It just works. I need this when I'm traveling and the only available network is wireless.

  • Toggle external display: Press the right button combination, and it just works. This is important. With X, I could send the display to a projector or to the built-in LCD screen, but not to both simultaneously.

  • PocketPC sync: ActiveSync just works. Despite valiant efforts, I couldn't get synce and Evolution to do it.

  • Suspend/resume: This is required for a portable computer. With Windows, it just works. FC4 could suspend like a champ, but it couldn't resume properly.

  • VPN: The Cisco VPN client just works. This is another thing I need when I'm away from the office.

As much as I would prefer to have Fedora Core as my PC's OS, it just doesn't cut it on the D610. Windows simply works better on this hardware. I now run FC5 as a VMWare guest OS, and it's almost as good as the real thing.

2006-02-22

New puppy

Jake and pup

This is Jersey, our new puppy. Jersey was rescued form a ditch in Arkansas with his two litter-mates on January 7. He lived in a foster home in Arkansas until Bruni spotted him on PetFinder.com. Bruni applied to adopt him through Great Dog Rescue New England, and he was quickly transferred from Arkansas to Blackstone Valley Veterinary Hospital in Uxbridge. A previous dog adopter visited our home to make sure the puppy would be OK, and Bruni and Jake brought him home yesterday afternoon.

Jersey is about three months old and seems to be potty trained already. He is some sort of rat terrier mix. His foster mom and the Blackstone Valley Veterinary Hospital took good care of him--he is clean, has had all his shots, and was neutered.

Jake is excited to have a dog, and Jersey seems happy to have new companion in a loving home. Jake stayed up late last night and awoke early this morning to take Jersey out for potty walks. Jersey was a little shy last night, but this morning he is more playful. Jake and Jersey have been inseparable since they found each other yesterday. Both are happy little pups.

2006-02-21

How to play MPEG videos on FC4

Out of the box, my FC4 does not play MPEG videos. When I use FireFox to browse to a sample video, I tell FireFox to open it in the default application, Totem. Totem runs, and a window appears, complaining that it doesn't know how to decode the file.

To install MPEG video support for Totom, I type:

$ sudo yum install gstreamer-plugins-extra-video

After that, it just works.

2006-02-15

Soccer coach fundamentals

I played town league soccer as a kid and a handful of pickup games as a young adult. As an older adult, I have helped coach my son's teams, both officially and unofficially, since day one. Last year, I finally took a coaching training course, and I think I have the beginnings of a philosophy on coaching youth soccer. Soccer is about scoring goals. To score goals, you have to take shots on net. To take shots, you have to maintain possession of the ball. These two points are the essence of a good soccer team: maintaining possession, and taking shots on goal.

Taking shots on goal is truly fundamental, but I break down maintaining possession into subskills. To obtain possession, you steal the ball from your opponents. To maintain possession, you pass the ball to your teammates, dribble past your opponents, or use your body to shield the ball and prevent an opponent from stealing it. These four skills are the basis of maintaining possession.

During our training sessions, we play small-sided soccer-like games that teach and reinforce these fundamentals. Many of the games are listed in the Massachusetts Youth Soccer Statewide Curriculum U6-U12. The games are fun and teach the skills without the kids' realizing it.

The boys' success last season shows that this philosophy works. They were competitive in every match except one (which took place during a freak October blizzard), and practice attendance was high, even on cold rainy nights. The boys were excited about soccer, and I was glad to be a part of it.

2006-02-14

Book store car crash

As I shopped at my neighborhood grocery store on Saturday, a bored voice yawned a muffled request over the store's PA system: "... Doctor ... manager ... front of store ... thank you." The voice sounded so uninterested that I thought it must be a joke. It certainly couldn't be a request for help. If I were a doctor, I probably would have ignored the announcement.

I am not a doctor, so I did ignore it. A half hour later, I emerged from the store with my groceries and saw police tape along the sidewalk and an ambulance in front of the nearby book store. Hmmm, I thought, must have bean a heart attack or something--that call for a doctor makes sense now.

I continued on my way home, past the book store. As I rounded the corner, I saw what really happened:

Wow!

Whoa--that car took out the cafe bar and whoever was sitting there. Yikes. I hope no one was badly injured.

2006-01-26

MP3 & FC4

I got audio to work on the Dell Latitude D610 simply by running alsamixer and turning everything up to 11. I copied my MP3 library to the new box. I ran the default Music Player (Applications/Sound & Video/Music Player) and excitedly attempted to import my mp3 library folder. The result:

I want my MP3!

Bummer! What to do about it? How about installing the venerable XMMS. To start, I added the freshrpms repository to my yum configuration. I added a new yum repository file:

$ sudo emacs -nw /etc/yum.repos.d/freshrpms.repo

and defined it with this content:

[freshrpms]
name=FreshRPMs for Fedora Core $releasever - $basearch
baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/freshrpms
enabled=1
gpgcheck=1
gpgkey=http://freshrpms.net/RPM-GPG-KEY-freshrpms

I got the list of available MP3 players:

$ sudo yum list available | grep mp3
bmp-mp3.i386 0.9.7-1.2.fc4 freshrpms
xmms-mp3.i386 1:1.2.10-13.2.fc4 freshrpms

and installed XMMS with MP3 support:

$ sudo yum install xmms-mp3
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for xmms-mp3 to pack into transaction set.
xmms-mp3-1.2.10-13.2.fc4. 100% |=========================| 2.9 kB 00:00
---> Package xmms-mp3.i386 1:1.2.10-13.2.fc4 set to be updated
--> Running transaction check
--> Processing Dependency: xmms = 1:1.2.10 for package: xmms-mp3
--> Processing Dependency: libxmms.so.1 for package: xmms-mp3
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for xmms to pack into transaction set.
xmms-1.2.10-19.fc4.i386.r 100% |=========================| 17 kB 00:00
---> Package xmms.i386 1:1.2.10-19.fc4 set to be updated
--> Running transaction check
--> Processing Dependency: libmikmod.so.2 for package: xmms
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for mikmod to pack into transaction set.
mikmod-3.1.6-35.FC4.i386. 100% |=========================| 7.3 kB 00:00
---> Package mikmod.i386 0:3.1.6-35.FC4 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
xmms-mp3 i386 1:1.2.10-13.2.fc4 freshrpms 78 k
Installing for dependencies:
mikmod i386 3.1.6-35.FC4 updates-released 188 k
xmms i386 1:1.2.10-19.fc4 extras 1.9 M

Transaction Summary
=============================================================================
Install 3 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 2.1 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): xmms-mp3-1.2.10-13 100% |=========================| 78 kB 00:00
(2/3): xmms-1.2.10-19.fc4 100% |=========================| 1.9 MB 00:23
(3/3): mikmod-3.1.6-35.FC 100% |=========================| 188 kB 00:09
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e42d547b
Public key for xmms-mp3-1.2.10-13.2.fc4.i386.rpm is not installed
Retrieving GPG key from http://freshrpms.net/RPM-GPG-KEY-freshrpms
Importing GPG key 0xE42D547B "Matthias Saou (Thias) "
Is this ok [y/N]: y
Key imported successfully
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: mikmod ######################### [1/3]
Installing: xmms ######################### [2/3]
Installing: xmms-mp3 ######################### [3/3]

Installed: xmms-mp3.i386 1:1.2.10-13.2.fc4
Dependency Installed: mikmod.i386 0:3.1.6-35.FC4 xmms.i386 1:1.2.10-19.fc4
Complete!

I ran XMMS by selecting Applications/Sound & Video/Audio Player and loaded my MP3 directory. Looks like it works:

XMMS is your friend.

2006-01-25

Install HenPlus on FC4

HenPlus is a nice command line tool that I use instead of Oracle's SQLPlus. HenPlus is distributed as an RPM, but it requires libreadline-java, which isn't included in the FC4 distribution:

$ sudo rpm -i henplus-0.9.5-1.noarch.rpm error: Failed dependencies:
libreadline-java >= 0.7.3 is needed by henplus-0.9.5-1.noarch

The RPM of libreadline-java that is referenced on the HenPlus web page is a little stale. It requires obsolete versions libhistory.so and libreadline.so:

$ sudo rpm -i libreadline-java-0.8.0-1.i386.rpm
error: Failed dependencies:
libhistory.so.4 is needed by libreadline-java-0.8.0-1.i386
libreadline.so.4 is needed by libreadline-java-0.8.0-1.i386

I already have the current versions of these libraries installed:

$ rpm -ql readline | grep lib
/usr/lib/libhistory.so.5
/usr/lib/libhistory.so.5.0
/usr/lib/libreadline.so.5
/usr/lib/libreadline.so.5.0

and I don't want to pollute my install with obsolete libraries. My options to get HenPlus installed from the RPM are:

  • Create fake symbolic links to fool the RPM dependency system into thinking libhistory.so.4 and libreadline.so.4 exist. This is obviously a bad hack, and I'd rather not do it.

  • Download and install a fresher libreadline-java RPM. Maybe fresh RPMs package the newer .so files. I'd rather let yum do that kind of work for me, though—that's its job.

  • Configure yum to use JPackage. There is a fresh libreadline-java RPM on JPackage, and instructions for how to configure yum to get packages from JPackage. I think this is the way to go.

To configure yum to use the JPackage repository, I download the jpackage.repo file and copy it to /etc/yum.repos.d/:

$ sudo cp jpackage.repo /etc/yum.repos.d/

I edit jpackage.repo to enable only the Fedora Core repository:

$ sudo emacs -nw /etc/yum.repos.d/jpackage.repo

In jpackage.repo, I disable [jpackage-generic] and enable [jpackage-fc]. The top of the file originally looked like this:

[jpackage-generic]
name=JPackage (free), generic
mirrorlist=http://www.jpackage.org/jpackage_generic.txt
failovermethod=priority
gpgcheck=1
gpgkey=http://www.jpackage.org/jpackage.asc
enabled=1

[jpackage-fc]
name=JPackage (free) for Fedora Core $releasever
mirrorlist=http://www.jpackage.org/jpackage_fedora-$releasever.txt
failovermethod=priority
gpgcheck=1
gpgkey=http://www.jpackage.org/jpackage.asc
enabled=0

and now it looks like this:

[jpackage-generic]
name=JPackage (free), generic
mirrorlist=http://www.jpackage.org/jpackage_generic.txt
failovermethod=priority
gpgcheck=1
gpgkey=http://www.jpackage.org/jpackage.asc
enabled=0

[jpackage-fc]
name=JPackage (free) for Fedora Core $releasever
mirrorlist=http://www.jpackage.org/jpackage_fedora-$releasever.txt
failovermethod=priority
gpgcheck=1
gpgkey=http://www.jpackage.org/jpackage.asc
enabled=1

I save the file, exit Emacs, and install libreadline-java:

$ sudo yum install libreadline-java
Password:
Setting up Install Process
Setting up repositories
http://ftp.nara.wide.ad.jp/pub/Linux/fedora/core/updates/4/i386/repodata/repomd.xml: [Errno 4] IOError: HTTP Error 404: Date: Wed, 25 Jan 2006 18:43:46 GMT
Server: Apache
Content-Length: 254
Content-Type: text/html; charset=iso-8859-1
Trying other mirror.
updates-released 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
base 100% |=========================| 1.1 kB 00:00
jpackage-fc 100% |=========================| 951 B 00:00
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for libreadline-java to pack into transaction set.
libreadline-java-0.8.0-10 100% |=========================| 3.9 kB 00:00
---> Package libreadline-java.i386 0:0.8.0-10jpp set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
libreadline-java i386 0.8.0-10jpp jpackage-fc 21 k

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 21 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): libreadline-java-0 100% |=========================| 21 kB 00:00
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID c431416d
Public key for libreadline-java-0.8.0-10jpp.i386.rpm is not installed
Retrieving GPG key from http://www.jpackage.org/jpackage.asc
Importing GPG key 0xC431416D "JPackage Project (JPP Official Keys) "
Is this ok [y/N]: y
Key imported successfully
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: libreadline-java ######################### [1/1]

Installed: libreadline-java.i386 0:0.8.0-10jpp
Complete!

Now that libreadline-java is installed, I can install HenPlus from the RPM:

$ sudo rpm -i henplus-0.9.5-1.noarch.rpm

This time, it succeeds.

I have installed HenPlus, so I try to run it:

$ henplus
Exception in thread "main" java.lang.NoClassDefFoundError: org/gnu/readline/ReadlineCompleter

I bet there's a problem with the class path. I notice that the henplus executable is a shell script:

$ which henplus
/usr/bin/henplus
$ file /usr/bin/henplus
/usr/bin/henplus: Bourne shell script text executable

That's good—I can edit the file and fix the class path. The class path should include the libreadline-java jar file. To find the location of that jar file, I type:

$ rpm -ql libreadline-java | grep jar
/usr/lib/java/libreadline-java-0.8.0.jar
/usr/lib/java/libreadline-java.jar

I edit the henplus shell script:

$ sudo emacs /usr/bin/henplus

and replace

CLASSPATH=$CLASSPATH:$THISDIR/../share/java/libreadline-java.jar

with

CLASSPATH=$CLASSPATH:/usr/lib/java/libreadline-java.jar

I save the file, exit Emacs, and try again:

$ henplus
using GNU readline (Brian Fox, Chet Ramey), Java wrapper by Bernhard Bablok
creating henplus config dir
henplus config at /home/kasper/.henplus
---------------------------------------------------------------------------
HenPlus II 0.9.5 Copyright(C) 1997, 2003 Henner Zeller
HenPlus is provided AS IS and comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it under the
conditions of the GNU Public License
---------------------------------------------------------------------------
Hen*Plus>

Success! Now I can use HenPlus and get on with my life.

2006-01-12

Keeping the locate database fresh on FC4

In the default Fedora Core 4 installation, the locate database does not get updated automatically. If you haven't manually updated the database, you will see error messages like this:

foo:/home/kasper$ locate foobar
warning: locate: warning: database /var/lib/slocate/slocate.db' is more than 8 days old
warning: Please make sure the daily cron job is enabled in /etc/updatedb.conf
foo:/home/kasper$

To manually update the locate database, type this at a shell prompt:

$ sudo locate -u

To enable nightly locate database updates, edit file /etc/updatedb.conf. In that file, change

# Set DAILY_UPDATE to yes to enable running updatedb
DAILY_UPDATE=no

to

# Set DAILY_UPDATE to yes to enable running updatedb
DAILY_UPDATE=yes

The locate database will stay up to date, and you'll always be happy.

2006-01-09

Installing Eclipse on FC4

I often use Eclipse when I develop Java-based software applications. Installing Eclipse on FC4 is easy! I don't normally do development on Eclipse itself, so I install everything except the *-devel packages:

$ sudo yum install `yum info eclipse\* | grep Name | cut -d: -f2 | grep -v devel`

Surprisingly, this installs 70 packages!

To run Eclipse, I select Applications/Programming/Eclipse. This Eclipse has an unusual splash screen, announcing itself as

Fedora Eclipse
Based on Eclipse 3.1.1

I haven't done much with it yet, but it looks right so far.

LinkWithin

Related Posts with Thumbnails