Matt Youngblut’s Blog

May 14, 2008

XPath - Common Mistake

Filed under: day-to-day — Matt @ 2:45 pm

When dealing with XPath, an extra forward slash (/) can make the difference between your application performing and making the decision that XPath just isn’t the solution for you.  So what is the difference between /Product and //Product?  Huge.

/Product means “go find the Product element that are my children”.  The engine only needs to look at child nodes relative to the current location.

//Product means “go find all of the Product elements that are a descendant of mine - I don’t care where they are at”.   This means that if your document is 50 levels deep, the engine will look through each and every one of them to find a product element.  If you have 10,000 elements to look through and then you have to go diving down the tree as well, it is obviously a more expensive than it needs to be.

Sometimes you don’t know where the element will reside in your XML document, so // makes sense.  However, if you know where you are looking, you should always use /.  Neither is “wrong”, but one can be a LOT more expensive than the other.

I’ve seen two XPath queries written today - one at work and one on the web, and both of them were using the inefficient double slash (//).  I hope this helps anybody who is doing any querying using XPath.

May 6, 2008

Greatest Living Beard

Filed under: day-to-day — Matt @ 1:02 pm

AKA Beardface

October 7, 2007

More New Media

Filed under: expenses — Matt @ 1:07 pm

I forgot to post one other form of new media: satellite radio.  There’s another $13 out of your pocket each month.

October 1, 2007

The cost of connectivity

Filed under: expenses — Matt @ 9:35 pm

Old Media:

MY cell phone

  • Newspaper
  • Cable/Dish
  • Telephone

New Media:

  • Internet
  • Cell phone
  • data plan
  • messaging
  • blogs (that cost you $$)
  • etc.

The costs are not going to go down, at least not noticeably. How is a person to pay for it all? I guess a guy could get rid of the newspaper (use the internet), home phone (go with a cell), television (watch stuff on the internet). Then, in theory, you could do all of that from your phone. But I don’t want to do that! What is a guy to do? I’ll just rant and rave. Up next - the exorbitant price of a cell plan (remember when it used to cost $19.99 for 350 minutes? Those days are long gone…).

August 23, 2007

Have you heard the good news?

Filed under: gPhone — Matt @ 8:10 pm

Yeah, yeah, “He is risen”. That is good news. But there is more good news: the rumor mill is starting up again about a Google phone, or gPhone.

I was about to send out an email to everybody I know (especially those who think the iPhone is the end-all-be-all). Then I remembered blogging. I can reach the whole world, or at least Tim, the one person who reads my blog. Regardless, there is good news “coming”: the gPhone might only be a fortnight away. The rumor comes from India, but who cares where rumors start, just whether or not they are true.

Google is serious about getting into the market. Their latest test run involves putting ads on YouTube videos, which should translate nicely to the phone.

June 26, 2007

Speed Work

Filed under: running — Matt @ 8:56 pm

Today was speed day.  I only ran four sprints, but I think it was helpful.  Prior to that, I ran 3 miles.  The time wasn’t that great, but I was pleased that the 2nd half of the run was slightly faster than the first half (by a couple of seconds).  This shows that I might have a chance of being a consistent runner.  I hope so.  Danny is training hard.  I can tell.

June 25, 2007

I just felt like runnin’.

Filed under: running — Matt @ 10:22 pm

Run Forrest, run!  I decided to run tonight for the first time in (basically) a month.  I had the flu Sunday and this morning, but I know Danny is running and claiming he isn’t.  So I had to.  Whenever I slowed down, I knew that Danny wanted my head to look like his.  And I can’t have that.  The Bix is 7 miles.  I need to probably get up to 15 miles before that to stand a chance to the running that Danny is already doing.  And I need to do speed-work.  I’ve got 5 weeks.   I can do it.

One man’s attempt to control the pet population

Filed under: day-to-day — Matt @ 11:09 am

No, my dogs are already fixed. I’m just trying to control where they go. Like if put them in the pen in the garage (which allows them to go outside via the doggie-door, I don’t expect them to be running around the garage like they were today when I got home.

So I’m on attempt #6 to contain them:

  1. Put up a pen
  2. Tethered pen to wall because they got smart enough to move the pen
  3. Patched corners of door, as Harley discovered how to “chew through” chain-link fence
  4. Bound plywood to door because the patching didn’t work
  5. Used a heavy piece of oak, plus rolls of carpet, bags of sand, and bags of water softener salt because Harley ripped the plywood to shreds
  6. The latest attempt (today): Put up a wrought-iron fence on the outside of the door, tethered by 1/8″ steel cables, because Harley figured out how to move the piece of oak and drag everything into the pen and chew it to shreds.

It now looks like a window in Miami or New York City at the bottom of the door. If this doesn’t work, I’m going to use electric fencing. I’ve been thinking about doing that since attempt #4, but it just seems so inhumane to me.

Blog at WordPress.com.