How to Organize Your House Using XML

Posted by 5x5 on November 16, 2009 under Computers, Geek Talk | Read the First Comment

Wouldn't it be nice to never have to clean your refrigerator again!

Never clean your refrigerator again!

A recent tweet sent me off into dreamland.

@eqhmcow: “Remain calm. I’m coming to your house to parse XML with regex. http://bit.ly/3×9sQX (via @marcusramberg)”

Being a bit dyslexic I swapped a few of those words around in my initial translation and began to imagine – what if you could organize your entire house with XML and have several cron jobs parse it on a weekly, daily, hourly basis to maintain organization and get rid of dirt and clutter!

It would look something like this:

<?xml version="1.0" encoding='UTF-8'?>
   <house>
      <kitchen>
         <cabinets>
            <left-top-cabinet>
               <drinkware>
                  <glass-clean>Blue Goblet Tall</glass-clean>
                  <glass-clean>Blue Goblet Short</glass-clean>
                  <glass-clean>Wine Glass</glass-clean>
                  <mug-clean>Coffee Mug</mug-clean>
                  <mug-clean>Beer Mug</mug-clean>
               </drinkware>
            </left-top-cabinet>
            <right-top-cabinet>
               <dishware>
                  <plate-clean>Dinner Plate</plate-clean>
                  <plate-clean>Salad Plate</plate-clean>
               </dishware>
               <bakeware>
                  <pyrex-clean>Two Quart Casserole</pyrex-clean>
                  <pyrex-clean>Four Quart Casserole</pyrex-clean>
                  <pan-clean>Cookie Sheet</pan-clean>
               </bakeware>
            </right-top-cabinet>
            <left-bottom-cabinet>>
               <cat-area>
                  <cat-groomed>Amanda Sue</cat-groomed>
                  <cat-blanket-clean>Pink Cat Blanket</cat-blanket-clean>
               </cat-area>
            </left-bottom-cabinet>
         </cabinets>
         <refrigerator>
            <top-shelf>
               <bread>Sandwich Bread</bread>
               <bread>Pita</bread>
               <bread>Potato Hot Dog Rolls</bread>
            </top-shelf>
            <middle-shelf>
               <beverage-chilled>Milk</beverage-chilled>
               <beverage-chilled>Orange Juice</beverage-chilled>
            </middle-shelf>
            <crisper-drawer-right>
               <fruit>Apple</fruit>
               <fruit>Oranges</fruit>
               <fruit>Pears</fruit>
            </crisper-drawer-right>
            <crisper-drawer-left>
               <vegetable>Lettuce</vegetable>
               <vegetable>Eggplant</vegetable>
            </crisper-drawer-left>
            <door-shelf>
               <condiment>Mustard</condiment>
               <condiment>Ketchup</condiment>
               <condiment>Horshradish</condiment>
               <wine-chilled>Chaddsford Riesling 2005</wine-chilled>
               <beer-chilled>Duck Rabbit Amber Ale</beer-chilled>
               <beer-chilled>Lindemans Lambic Framboise Belgium</beer-chilled>
               <beer-chilled>Guinness</beer-chilled>
               <beer-chilled>Shiner Bock</beer-chilled>
            </door-shelf>
         </refrigerator>
         <dishwasher>
            <glass-dirty>Blue-Goblet-Tall</glass-dirty>
            <glass-dirty>Blue-Goblet-Short</glass-dirty>
            <glass-dirty>Wine-Glass</glass-dirty>
            <mug-dirty>Coffee-Mug</mug-dirty>
            <mug-dirty>Beer-Mug</mug-dirty>
            <plate-dirty>Dinner-Plate-Clean</plate-dirty>
            <plate-dirty>Salad-Plate-Clean</plate-dirty>
         </dishwasher>
         <pantry>
            <baking-supplies>Flour</baking-supplies>
            <baking-supplies>Sugar</baking-supplies>
            <canned-goods>Peas</canned-goods>
         </pantry>
      </kitchen>
      <kids-bedroom>
         <bed>
            <sheets-clean>Blue Cotton</sheets-clean>
            <comforter>Pac Man Comforter</comforter>
         </bed>
         <closet>
            <kid-pants-clean>Blue Jeans</kid-pants-clean>
            <kid-shirts-clean>Transformer Shirt</kid-shirts-clean>
         </closet>
         <toy-chest>
            <toy>GI Joe</toy>
            <toy>Legos</toy>
            <toy>Lincoln Logs</toy>
         </toy-chest>
      </kids-bedroom>
      <office>
         <desk>
            <computer>Macbook Pro</computer>
            <printer>
               <paper>Plain White Paper</paper>
               <ink>Canon Black</ink>
            </printer>
         </desk>
         <bookshelf-one>
            <book>Agile Web Development with Rails</book>
            <book>Hanbook of Usability Testing</book>
            <book>JavaScript Bible</book>
            <book>Don't Make Me Think</book>
            <book>Linux + Fundamentals and Certification</book>
         </bookshelf-one>
         <bookshelf-two>
            <book>Principles of Biochemistry</book>
            <book>Molecular Biology</book>
            <book>Predictably Irrational</book>
            <book>Beautiful Joe</book>
            <book>Still Life With Woodpecker</book>
         </bookshelf-two>
      </office>
      <living-room>
         <sofa>
            <cat>Jasper</cat>
            <cat>Wallace</cat>
         </sofa>
         <end-table-left>
            <lamp>Lamp With Black Shade</lamp>
         </end-table-left>
         <end-table-right>
            <lamp>Lamp With Black Shade</lamp>
         </end-table-right>
         <dog-bed>Chas</dog-bed>
      </living-room>
      <full-bath>
         <sink>
            <sink-top>
               <toothbrush>Blue Toothbrush</toothbrush>
               <toothbrush>Green Toothbrush</toothbrush>
               <toothbrush>Electric Toothbrush</toothbrush>
               <tissues>Puffs</tissues>
               <soap>Liquid Handsoap</soap>
            </sink-top>
         </sink>
            <toilet-paper-holder>
               <toilet-paper>Scotts Extra Soft Toilet Paper</toilet-paper>
            </toilet-paper-holder>
            <tub>
               <soap>Leaver 2000</soap>
               <shampoo>Redken Fresh Curl</shampoo>
               <conditioner>Mark Anthony Curl</conditioner>
             </tub>
      </full-bath>
   </house>

Next, you’ll need a simple process to automatically put everything in the proper place. e.g the dirty dishes where they need to be, the clean dishes where they need to be. You’ll want positive and negative controls on various items.  For example, you’ll want a process to monitor the refrigerator door-shelf in case it runs out of beer.  When the process sees you are not maintining the minimum number of 3 <beer-chilled>, it will restock <refrigerator><door-self> with <beer-chilled> for you.

<refrigerator>
   <door-shelf>
      <condiment>Mustard</condiment>
      <wine-chilled>Chaddsford Riesling 2005</wine-chilled>
      <beer-chilled>Duck Rabbit Amber Ale</beer-chilled>
   </door-shelf>
</refrigerator>

You might even wish to define some of the tags within your process to say, keep your <beer-chilled> at 40 degrees ferinheight. Perhaps the process could even compile a list of everything you need and do your grocery shopping for you.

You’ll also want a process that monitors for undefined DTD items like dust and dirt, so they can be eliminated from the house.  You’ll probably want to have a saftey on this device in case your new

<office>
   <desk>
      <laptop>MacBook Pro</laptop>
   </desk>
</office>

did not get entered into the DTD before the process ran, because you were too excited to use the new computer when you got home and forgot to add it to the list.

If you’ve gotten this far in the post, I believe you have enough good whits about you to have the general idea of how this would work.  How would you make this XML organized house more efficient? What type of processes would you write? Can someone please make this physically possible!?

Bookmark and Share
  • When two negatives equal a positive. | Crazy Like That Blog said,

    [...] Negative: House cleaning. You name the task, fill the dishwasher, empty the dishwasher, clean the kitchen counter, wash the laundry, fold the laundry, sweep, mop, vaccuume, toilets! Why can’t houses clean themselves? [...]

Add A Comment