I’ve been marking an M on a calendar for every day I meditate and so far I’m lucky to average three times a week. I’ve been getting better though the last few weeks, both at quieting my thoughts quickly and actually doing it. I think next month I might mark every day with an M and check off the days I meditate. It’s a small change, but I think I’ll have better motivation to cross things off than to mark M’s.
Oooooooooooooommmmmmmmm
Connecting Rails to Pervasive SQL ODBC
I’d been putting off trying to link my rails app to our accounting deparment’s Pervasive SQL database because I thought it would be really hard. Turned out to be quite easy using ODBC. It might be nice if in the future someone wrote an adapter specifically for Pervasive SQL, but for now ODBC does what I need which is allow me to access employee data already populated in the accounting database so that I don’t have to duplicate in the rails database. I found the code to get me going on this from the first reply at this Ruby Forum conversation. Below is a method I defined in my employee controller.
def sync
@conn = DBI.connect('DBI:ODBC:odbc_name','username','password')
Employee.current_employees.each do |emp|
rs = @conn.select_one('SELECT EMPLOYEE.WC_Code, EMPLOYEE.Employee_Name
FROM EMPLOYEE WHERE ((EMPLOYEE.Employee) = \'' +
emp.employee_number.to_s + '\')')
emp.empl_workers_comp_code = rs["WC_Code"] unless rs.nil?
emp.save
end
redirect_to :action => 'list'
end
The only problem is I can only seem to call this method while running WEBrick. If I try the method while running Mongrel I get
DBI::DatabaseError in EmployeesController#sync
S1000 (-4019) [TimberlineODBC][TimberlineODBCEngine ODBC Driver][DRM File Library]Drive or directory unavailable [IO-WIN 3]
Screen\OD.scr
RAILS_ROOT: c:/rails/kj/config/..
Application Trace | Framework Trace | Full Trace
c:/ruby/lib/ruby/site_ruby/1.8/DBD/ODBC/ODBC.rb:95:in `connect'
c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:584:in `connect'
c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:384:in `connect'
#{RAILS_ROOT}/app/controllers/employees_controller.rb:9:in `sync'
c:/ruby/lib/ruby/site_ruby/1.8/DBD/ODBC/ODBC.rb:95:in `connect'
c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:584:in `connect'
c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:384:in `connect'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.2/lib/action_controller/base.rb:910:in `perform_action_without_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.2/lib/action_controller/filters.rb:368:in `perform_action_without_benchmark'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.2/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue'
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.2/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.2/lib/action_controller/rescue.rb:82:in `perform_action'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.2/lib/action_controller/base.rb:381:in `process_without_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.2/lib/action_controller/filters.rb:377:in `process_without_session_management_support'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.2/lib/action_controller/session_management.rb:117:in `process'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.3/lib/dispatcher.rb:38:in `dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.2-mswin32/lib/mongrel/rails.rb:85:in `process'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.2-mswin32/lib/mongrel.rb:563:in `process_client'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.2-mswin32/lib/mongrel.rb:562:in `process_client'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.2-mswin32/lib/mongrel.rb:648:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.2-mswin32/lib/mongrel.rb:648:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.2-mswin32/lib/mongrel.rb:637:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.2-mswin32/lib/mongrel.rb:969:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.2-mswin32/lib/mongrel.rb:968:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel_service-0.1/bin/mongrel_service:84:in `service_main'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel_service-0.1/bin/mongrel_service:153
c:/ruby/bin/mongrel_service:18
c:/ruby/lib/ruby/site_ruby/1.8/DBD/ODBC/ODBC.rb:95:in `connect'
c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:584:in `connect'
c:/ruby/lib/ruby/site_ruby/1.8/dbi/dbi.rb:384:in `connect'
#{RAILS_ROOT}/app/controllers/employees_controller.rb:9:in `sync'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.2/lib/action_controller/base.rb:910:in `perform_action_without_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.2/lib/action_controller/filters.rb:368:in `perform_action_without_benchmark'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.2/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue'
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.2/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.2/lib/action_controller/rescue.rb:82:in `perform_action'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.2/lib/action_controller/base.rb:381:in `process_without_filters'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.2/lib/action_controller/filters.rb:377:in `process_without_session_management_support'
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.2/lib/action_controller/session_management.rb:117:in `process'
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.3/lib/dispatcher.rb:38:in `dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.2-mswin32/lib/mongrel/rails.rb:85:in `process'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.2-mswin32/lib/mongrel.rb:563:in `process_client'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.2-mswin32/lib/mongrel.rb:562:in `process_client'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.2-mswin32/lib/mongrel.rb:648:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.2-mswin32/lib/mongrel.rb:648:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.2-mswin32/lib/mongrel.rb:637:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.2-mswin32/lib/mongrel.rb:969:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-0.3.13.2-mswin32/lib/mongrel.rb:968:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel_service-0.1/bin/mongrel_service:84:in `service_main'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel_service-0.1/bin/mongrel_service:153
c:/ruby/bin/mongrel_service:18
and a different error in Apache that I can’t reproduce right now. I’ll probably have to figure this out sooner or later once I have more data that needs to be synced on a regular basis. I tried just writing a method for the model that returns the data in question from the Pervasive database, thus providing completely updated data on every request and avoiding storing the data on the rails database, but it was waaaaaaay too slow. Maybe if there were a Pervasive SQL adapter it would be faster than over ODBC.
East Coast Trip
After the worst turbulence I’ve ever experienced on a flight, Kim and I arrived exhausted Friday morning in Connecticut. We spent the day with Kim’s aunt and grandma. We played Skip-bo, looked at pictures, and took naps.
Effie picked us up that night and we hung out at her place. I hadn’t met their dog Winston or seen their house they bought before. Winston is a Basset hound and very cool. He’s fun because he’ll play like a puppy, but he’ll go to chill mode instantaneously.
Saturday we just hung out waiting for Kim’s surprise to be setup. Kim was very pleasantly surprised by her bridal shower. Her mom had flown in unknown to me even, and a ton of her friends and family were there. I escaped quickly with Jack and Mike to watch the U.S. world cup game and get away from all girls. We came back and had to sit outside while the girls continued their party. It finally wound down and we were allowed back in the house. We hung out for a while drinking and singing karaoke.
Sunday morning Effie, Kim and I took off for Vermont to start the wedding errands. We got to the Inn at Baldwin Creek to do our food testing. It looks like Kim picked a good spot and some good food. I’m looking forward to having a big party there in the fall.
We camped with a tent Effie got from her boss. The thing was huge! It must have measured 7 feet tall when we finally got it setup with the help of some of our camp neighbors. You could easily fit more than 10 people in this tent.
Monday we found rehearsal dinner locations and scoped out a park for a little picnic the day after the wedding. Those were all the major things that we needed to do, so I feel very good about how the planning is going. We headed back to Connecticut through a thunderstorm to relax a bit.
Tuesday was very chill for Kim and I since Effie and Jack both had to go to work and we had no transportation. We took Winston for a walk before Effie came home to take us to the airport. Our flight was a pain in the ass again. The worst for me was there was a problem with our plane, so they had us change gates during our layover and we got an old one. It was soooo uncomfortable. Of course, my seat didn’t recline, but the person’s in front of me did. Okay enough complaining, but Northwest/Delta are lame. At least they got me where I wanted to go.
Jason Webley at the Can Can
As always, Jason puts on an awesome show. Kim and I went down after I got out of working late and saw Jason at the Can Can near Pike Place Market. We both realized that we had been to the Can Can a while ago when it was something else. It’s a lot nicer now that they’ve moved things around and it’s not smokey.
Jason stomped, played accordian and guitar, and just plain entertained everyone in the place with music, stories and funny dances. He’s one hell of a showman. From his own piratey, meloncholy stuff to orginal lyrics covers of Bob Marley and Outkast, the show was excellent. Tonight’s fun crowd activity was tickling everyone around you to the tune of Music That Tears Itself Apart.
If you live in Seattle and haven’t seen Jason Webley play, you haven’t begun to experience one of the best Seattle has to offer.
Family and Friends in Eastern Washington
Kim and I went home to my parents this weekend to visit them and Kim’s old college roommate, Lauren, who had just gotten married to a guy named Kevin from Newman Lake near Spokane. We got in late Friday night and chatted with my parents well past their bed time. My Dad was up late studying for his college class. The next day I helped my dad a bit with moving some stuff out of Nathan’s room. We burned an old, nasty, green sofa that we’ve had for more than 20 years. Then we played euchre out on the deck in the nice weather.
Since Lauran and Kevin had gotten married in Connecticut where Lauren is from, they had another reception in Newman Lake for Kevin’s family who couldn’t make it to the wedding. They had a huge tent and Longhorn Barbeque catered. Kim and Lauren were very happy to see each other after more than 4 years and had plenty to talk about. It turned out that I had connections to a few of the people at the party through Newport families and the Nsidsen church camp. Lauren and Kevin were flying back east the next day, all the way to Germany since Kevin has a few more years in the military, so Kim and I left around 10pm.
Sunday we went to Grandma’s and we looked at some of the old pictures that I’ve been scanning from my parents’ film. Afterwards we went to dinner at the Olive Garden. Kim and I drove back from there and ran into Danny’s mom and his girlfriend Kari at a gas station in Ellensburg. Small world.