Archives

General

Down and Dirty Timezone Migration

Our application at work is very dependent on users having their timezone set. We store all our event times in UTC/GMT and thus we need the user’s timezone to properly display it for them so it makes sense. Turns out we missed some spots where we weren’t setting timezone plus we had a fair amount of early accounts that never had it set cuz timezone came later.

So most all of our accounts have an address so i figured we could look up the timezone based on the address. I first looked at Google’s geocode api and we could use that to submit and get the timezone based on address but they only allow 25k requests per day for free. I had to convert some ~424K so i could do a few every day for several days of maybe not.

Next I thought well i already know the address and based on state you can figure out the basic timezone. I know time is hard in programing cuz of all the strange geography across the us, but i figured i could 90% covered by just doing the basics.

So i just used the following array to compare the state and then set the timezone based on the match. I still need to updated it for Canada provinces but this is working fine for now.

$tz_states = array(
'America/Los_Angeles' => array('CA', 'NV', 'OR', 'WA'),
    'America/New_York' => array('CT', 'DE', 'FL', 'GA', 'ME', 'MD', 'MA', 'NH', 'NJ', 'NY', 'NC', 'OH', 'PA', 'RI', 'SC', 'VT', 'VA', 'DC', 'WV'),
    'America/Anchorage'=>array('AK'),
    'Pacific/Honolulu'=>array('HI'),
    'America/Boise'=>array('ID'),
    'America/Chicago'=>array('AL', 'AR', 'IL', 'IA', 'KS', 'LA', 'MN', 'MS', 'MO', 'NE', 'OK', 'SD', 'TN', 'TX', 'WI'),
    'America/Denver'=>array('CO', 'MT', 'NM', 'UT', 'WY'),
    'America/Detroit'=>array('MI'),
    'America/Indiana/Indianapolis'=>array('IN'),
    'America/Kentucky/Louisville'=>array('KY'),
    'America/North_Dakota/Center'=>array('ND'),
    'America/Phoenix'=>array('AZ'),
);

full code can be found here

All city band. @SeattleReignFC halftime http://t.co/iD6TTqSXuB

Embed code not available


from Twitter http://ift.tt/V35tr2

August 06, 2014 at 08:08PM
via IFTTT

@SeattleReignFC 3-0. Go reign! http://t.co/GHCJbFbxYM

Embed code not available


from Twitter http://ift.tt/V35tr2

August 06, 2014 at 07:54PM
via IFTTT

Iphone

This post is from my iPhone. I’ve only had my iPhone for a few days but this is pretty cool. Sitting in bed, writing a blog post! This just might inspire me to write more often. This along with ssh and of course Rhapsody and maps and kexp … The list goes on. Welcome to the modern world old man.

What you can get me for my birthday

It’s that time of the year when I update my “what you can get me for… ” post. It has been some time since my last one and things have changed a little but most of the items from my previous posts didn’t leave the list. So again this year I’ve found a few items that seem reasonable for my birthday list, so I thought i’d re-purpose the list again for xmas and add a few things. Here we go… The list will probably change so come back often and it still includes some big things. In no particular order:
  • David Vantage Pro2 Weather station.  check out Ambient Weather and Provantage. You must request a price quote via email – an automatic response is returned with a new link promptly. They are not allowed to post to the public their discounted prices.
  • cool new laptop backpack like this booqbag.
  • One of these cool shirts: http://www.thinkgeek.com/tshirts-apparel/interactive/ I particularly like the “Wi-Fi detector shirt” and the “T-Qualizer Shirt
  • An ATHF Mooninites patch. Either both Ignignokt and Err or either one of them alone. I desperately want to cover up my Real logo on my computer bag. I think I have one of these patches but can’t find it.
  • Beer Cozy for my Pabst cans!
  • Been reading more so good books. Nothing too heavy now. I like fast, easy, with short chapters
  • Washington State Liquor Gift Card – more info
  • Home Depot gift cards are nice and help offset house projects
  • I could use some more running shorts. I like the longer style, not the true runner’s shorts. Robin got me some Nikes called NikeFit and they are kind of longish like basketball shorts, but not too long, something above the knee but below the mid thigh. (can you say high maintenance?!) Oh and I like the polyester wicking fabric of course… no cotton. I’m a Medium or 33/34 waist.
  • Running shirts that are short sleeved, white or light color, like gray or light blue. I’m a large and again the sweet wicking fabric.
  • All-In-One clamp guide accessories. I recently got some great clamps at the Rockler T-Day sale and now it would be nice to have a couple of the accessories for them. Namely the Router Plate and Saw Plate for the clamps. Both can be found here.
  • the winning lottery ticket
  • The new MacBook Pro 15 inch
  • If you are already doing the MacBook, why not go a little further and also get me a Cinema Display
  • New Gas stove and range like the Dacor Epicure 48″ dual fuel. Along with that we need the Epicure Raised Vent also. We don’t want to have to put a traditional hood in.
  • I think I’ve fixed the leak in the car, so now i just need the new driver’s seat for my CRX
  • Maybe a new “CRX” like a diesel Jetta or Golf/Rabbit
  • Or Maybe just a scooter

What you can get me for X-Mas

Since most of the items from my post on what you can get me for my birthday didn’t leave the list, I thought for x-mas, I’d just re-post and make a few additions. Just as with my birthday, year usually around ThanksGiving when the family gets together, I get the question “what do you want for Christmas?” and I always don’t know what to say. Partially because I immediately think of the big things I want or need and have trouble of thinking about smaller items. So again this year I’ve found a few items that seem reasonable for my birthday list, so I thought i’d re-purpose the list again for xmas and add a few things. Here we go… The list will probably change so come back often and it still includes some big things. In no particular order:
  • One of these cool shirts: http://www.thinkgeek.com/tshirts-apparel/interactive/ I particularly like the “Wi-Fi detector shirt” and the “T-Qualizer Shirt
  • An ATHF Mooninites patch. Either both Ignignokt and Err or either one of them alone. I desperately want to cover up my Real logo on my computer bag. I think I have one of these patches but can’t find it.
  • Beer Cozy for my Pabst cans!
  • David Vantage Pro2 Weather station.  check out Ambient Weather and Provantage. You must request a price quote via email – an automatic response is returned with a new link promptly. They are not allowed to post to the public their discounted prices.
  • Been reading more so good books. Nothing too heavy now. I like fast, easy, with short chapters
  • Washington State Liquor Gift Card – more info
  • Home Depot gift cards are nice and help offset house projects
  • I could use some more running shorts. I like the longer style, not the true runner’s shorts. Robin got me some Nikes called NikeFit and they are kind of longish like basketball shorts, but not too long, something above the knee but below the mid thigh. (can you say high maintenance?!) Oh and I like the polyester wicking fabric of course… no cotton. I’m a Medium or 33/34 waist.
  • Running shirts, white or light color, like gray or light blue. I’m a large and again the sweet wicking fabric.
  • My mighty mouse is starting to die. I’ve opened it and cleaned it twice now to prolong it’s life, but now it stutters and pauses every once in a while so I think it’s on it’s last legs. The good news is Apple has a cool new mouse – the Magic Mouse!
  • All-In-One clamp guide accessories. I recently got some great clamps at the Rockler T-Day sale and now it would be nice to have a couple of the accessories for them. Namely the Router Plate and Saw Plate for the clamps. Both can be found here.
  • the winning lottery ticket
  • The new MacBook Pro 15 inch
  • If you are already doing the MacBook, why not go a little further and also get me a Cinema Display
  • The new iphone 3GS. In my birthday list I also asked for 6 months of service, but I think I need the phone more now and I’ll figure out the service fees.
  • New Gas stove and range. One were the vent is attached and popus up from back. We don’t want to have to put a traditional hood in.
  • I think I’ve fixed the leak in the car, so now i just need the new driver’s seat for my CRX
  • Maybe a new “CRX” like a diesel Jetta or Golf/Rabbit
  • Or Maybe just a scooter

People and Their Trash

Why are people so protective of their trash? A couple of years back Robin and I were on a dog walk and after the dog took a shit, we picked it up in our plastic bag like good dog owners. We walked on a block or so and then I ran in to the next ally and dropped it into a trash can. Well, by the time we reached the middle of the next block a woman came running up with our bag of poop yelling at us. She did not appreciate us depositing our trash into her trash can. She also made a note that she didn’t have a dog. We apologized and gladly took the poop bag back continued on our walk. At first I could kind of understand were she was coming from but at the same time I couldn’t really understand the big deal. Doesn’t it all end up in the same place? I know that we all have to pay for our trash but it didn’t seem like this small item was going to push her over the edge and cost her an extra fee for too much in her container. Was she worried that my trash was going to react some how with hers? Was the garbage collector guy going to judge her some way for having a poop bag in her trash?… “That’s funny, Mrs. Smith usually doesn’t have poop in her trash. I wonder if something is wrong?”. Recently as I’ve taken my run and/or walked the dog on trash day or the day after, I’ve noticed that people will have their yard waste and recycling cans out in front of their house but not the trash. Personally we keep ours all together and couldn’t imagine having the trash can separate from the rest of the “waste”. So what is it with people? What is so private about our trash that we have to hide it away and keep it untainted by other’s trash? Is it a security thing? As far as the poop goes, we’ve recently purchased a in-ground dog waste digester from Dr. Foster Smith and I’m going to order some digester safe/Flushable poop bags. So from now on the poop won’t be going in yours or my trash and better yet it won’t be commingling at the dump.

1/2 Marathon Training – Week 7 End

Week 7 of the training ends with the longest run that I think I’ve ever done. I think I might have done a 6 mile run back in high school the summer I trained with the cross country coach, but defiantly not after until now. But today was I guess my personal best, doing 7 miles in about 66 minutes. Instead of Greenlake loops, I decided to do another new course along the Burke Gilman trail. Ususally I do better if it’s new as I’m not familiar and before I know it I’m done. If i do this run again, it probably will be a little harder. I enjoyed the course very much and would love to take the dog down for part of it for a nice walk, especially along the canal in Fremont area. Also found some good spots to watch the Gasworks 4th fireworks. So might be heading down that way this year. I started on the trail at the Fred Meyers in Ballard and ran through Fremont along the water front park, by Gasworks park and around the top of Lake Union to the edge of the UW and then back. You’d think going from Ballad to the UW would be more then 3.5 miles, but according to Favorite Run Google mapping it’s not. The course was pretty flat and easy and definitely had nice views of the canal and lake. I think I’ll try to plan more long runs along here. Next week, week 8, is basically a repeat of week 7, 4.5 Tues/Thurs., 3 on Wed. but then a step up on the Sunday long run to 8 miles. That should be interesting. I think I’ll do the same run as today and add the extra 1/2 mile into the UW.

What you can get me for my B-day

My birthday is less then a month away and so you probably better start thinking about that great gift you are going to get me. Every year about a week away I get the question “what do you want for you birthday” and I always don’t know what to say. Partially because I immediately think of the big things I want or need and have trouble of thinking about smaller items. Well this year I’ve found a few items that seem reasonable, so I thought i’d get the list out there for everyone. Here we go… The list will probably change so come back often and it still includes some big things. In no particular order:
  • One of these cool shirts: http://www.thinkgeek.com/tshirts-apparel/interactive/ I particularly like the “Wi-Fi detector shirt” and the “T-Qualizer Shirt
  • An ATHF Mooninites patch. Either both Ignignokt and Err or either one of them alone. I desperately want to cover up my Real logo on my computer bag. I think I have one of these patches but can’t find it.
  • A nice but not expensive digital camera that uses SD so I can use it with the item farther down the list ;-). The camera on my phone is okay, but I want to start taking nicer images. I’m talking a little basic one, not one of those full cameras where you can changed the lenses etc.
  • Beer Cozy for my Pabst cans!
  • David Vantage Pro2 Weather station.  check out Ambient Weather and Provantage. You must request a price quote via email – an automatic response is returned with a new link promptly. They are not allowed to post to the public their discounted prices.
  • Been reading more so good books. Nothing too heavy now. I like fast, easy, with short chapters
  • Washington State Liquor Gift Card – more info
  • Home Depot gift cards are nice and help offset house projects
  • I could use some more running shorts. I like the longer style, not the true runner’s shorts. Robin got me some Nikes called NikeFit and they are kind of longish like basketball shorts, but not too long, something above the knee but below the mid thigh. (can you say high maintenance?!) Oh and I like the polyester wicking fabric of course… no cotton. I’m a Medium or 33/34 waist.
  • Along with shorts, I could use some new running socks. I like the short ones that just cover the ankle, not the really short ones ala “bobby socks”. Again, the sweet wicking fabric. I like the ones from The Walking Company. Shoe size 9.5.
  • Running shirts, white or light color, like gray or light blue. I’m a large and again the sweet wicking fabric.
  • the winning lottery ticket
  • The new MacBook Pro 15 inch
  • If you are already doing the MacBook, why not go a little further and also get me a Cinema Display
  • The new iphone 3GS, but if you get me this, you also have to pay for at least 6 months service cuz I can’t afford it right now.
  • New Gas stove and range. One were the vent is attached and popus up from back. We don’t want to have to put a traditional hood in.
  • someone to fix my leak in my CRX before the rains start.
  • New driver’s seat for my CRX
  • Maybe a new “CRX” like a diesel Jetta or Golf/Rabbit
  • Or Maybe just a scooter
  • #1 I guess would be a job, but not starting until like September ;-). Something fun, cool, cutting edge that pays well with good benefits, flexible work schedule, open environment, lets my dog come to work, has perks like free parking and paid cell phones, game room, Macs, little or no commute and something I can retire from after 5 years. Woodworking, Renewable Energy or Computers… something creative where I can build and create be it a software app or fence or electricity.

1/2 Marathon Training – Week 2, Day 3

Day 3 of week 2… a 2 mile run. After yesterday’s bad run today was much better. Not sure if it was getting back to the mornings or maybe the new mix on the Sansa, but I felt much better and almost back to normal. It was colder this morning and the start was a little hard with the fozen hands… need to look at getting some light gloves. Again, 2 miles in 19 minutes and I felt so good i actually did a little more… probably another quarter to half mile. Tomorrow is back to the 3 miles and well see if it will be as good as today. I’ll again have time in the morning and I think I’ll download the new Silversun Pickups album for my listen pleasure.
v.sg