tomhoppe.com

Racing, Web Development, Photography, and Beer...Stuff that matters.

Monday, January 12, 2009

The remodel continues (finishes?)

Since we moved into the house, we've been planning to update pretty much the whole look of the house. We've done a fair share of things, kitchen, downstairs paint, master bedroom paint, etc, but we certainly have started to slack off a bit.

With the mortgage rates being so down, we decided to refinance. With the refinance comes an appraisal. With the appraisal.....holy crap, we've got a lot to do! lol. We realized that we have to finish up all the "almost done" projects, as well as do a couple more updates in order to appraise at the number we need to get our super low rate. Loooong list of to-dos, but working our asses for through the next week, should have everything done.

  • Office and Guest Bathroom
    • Paint walls
    • Prime and paint windows and trim
    • Prime and paint closet doors
    • Replace outlets
  • Guest Bathroom and Laundry Room
    • Take down wallpaper and paint walls
    • Prime and paint cabinets in both
    • New light fixtures
  • Kitchen/Stairs
    • Finish crown molding
    • Prime and paint stairwell and trim
    • Prime and paint all doors
  • Upstairs Hallway
    • Crown molding
  • Outside
    • Replace shutters
    • Pull some bushes to clean up look
  • Clean all the carpets with our fancy Electrolux cleaning machine

Dang! Thats a lotta stuff.

Labels: ,

Monday, January 5, 2009

How many times does "x" occur in a string?

Had to figure out how many times a single characted occured in a string today. Found a nice clean way to do that instead of running a loop. Remove all the instances of that letter or character in the string, and the subtract that from the original length of the string. Viola.

You can also adapt this to multi character strings by dividing the result by the amount of chars in your search string. If you look for "asdf" in "1234asdf1234asdf1234asdf", you will remove 12 characters. Divide that by 4, and you have found "asdf" three times. Two examples below where the result is 3

str = 1234x1234x1234x;
str.length - str.replace(/x/gi,'').length;
str = 1234asdf1234asdf1234asdf
(str.length - str.replace(/xxxx/gi,'').length)/4

Labels: ,