Wednesday, July 18, 2012

Date Conversion With Perl

Recently I've started to keep a personal log as I'm coding.  This has already started to be a big help in terms of not-resolving problems while I'm working on a project.  At the same time, a number of my friends have started learning to code.

Since my logs are already pretty close to blog-post sized, I'll start posting a few of the more interesting ones, in hopes that they'll help people who are working on similar projects.

Recently, I've been working on a project where I want to use SQLite to work on some data files.  The data were initially stored in CSV files.  In the last couple days, I've gotten them converted to tab-delimited files, which will work better for the specific application.

The latest challenge came about when I was trying to use some date and time information in my data files.  It turns out that I'd downloaded them with the dates in a slightly wrong format.

In my files, the dates look like this:

29-Jun-04 13:04:40

SQLite wants dates that look like this:


2004-06-29 13:04:40

Sunday, January 16, 2011

10 Mi Run


Yesterday was supposed to be my first major run. But due to family visiting, I actually made it out today. But, today would have been a rest day, so it all balances out.

A- came out with me for the first 6 miles. So I came up with a loop that was easy to split into 2 loops. Also, I still can't find my waterbottle, so I ended up doing this without any water. I was surprised by how I didn't seem to miss it.

At first I was pretty disappointed with the pace. But then, I haven't run this long since the last half marathon. I also felt like I could have kept going at the end.

Mile 1: 11.12 HR 157
Mile 2: 11.01 HR 159
Mile 3: 11.22 (combined w/ 3 due to road blockage)
Mile 4: 11.22 HR 153
Mile 5: 10.58 HR 160
Mile 6: 11.19 HR 164
Mile 7: 11.21 HR 161
Mile 8: 12.08 HR 161
Mile 9: 11.57 HR 158
Mile 10: 12.00 HR 160

Total 1:54:44.

Thursday, January 13, 2011

Week 3, Day 4

Today was a 5mi run at an easy to moderate pace. I followed the loop I've been using, and felt better than I did on my last couple runs.

My times were:
Mile 1: 9.44.70 - HR163
Mile 2: 9.48.68 - HR169
Mile 3: 9.56.68 - HR166
Mile 4: 13.12.23 - HR166 (Had to stop for a traffic light near a school)
Mile 5: 10:48.60

Total: 53.30.89

So, still slow, but there seems to be some improvement. Also, it's good to see that my heart rate is in a reasonable zone.

The weather is 20F, 14F with windchill. I'm also not sure that I've been eating enough over the last few days, and will try to up my caloric intake and see if that helps, particularly just before the run.

Monday, January 10, 2011

Running: Day 2

Today was the second run in my training program. The training schedule called for an easy 5 miles. So, I shortened my loop from Saturday and went for it.

Today's run actually felt a good bit more difficult than the last one, even though I wasn't trying to go as fast.

Times:
Mile 1: [Stopwatch Error]
Mile 2: 10:24
Mile 3: 11:28
Mile 4: 14:21 (With some recovery)
Mile 5: 9:34

Total (4mi) 45:53

So, this was a lot slower than last time. I didn't eat breakfast before my run, and that might have had some impact. Or it could have been me recovering. Or maybe I just had an off day. I'll make an effort to eat more next time, and see if that changes anything.

Saturday, January 8, 2011

First Day of Marathon Training

Today, I started my marathon training. I'm starting the cool runnings schedule a few weeks late. After working it out on a calender, today would be Day 7, Week 4. So, it's a 6 mile run.

The run felt pretty good and my cold weather gear was great. Running tights are way more comfortable than my warm-ups, and my running vest and hoodie kept me warm when the wind picked up. (The weather report was 21 degrees, feels like 6).

Also, Rockbox has a stopwatch. So, I broke my run into mile times.

Mile Times:
9:42
9:32
10:53
10:37
10:31
10:17
Total:
1:01:35.34

So, on average I was running 10:16 miles, which would give me a marathon time of around 4:30. Hopefully I'll see some improvement.

Saturday, January 2, 2010

England (Days 6&7 Week 8/24)

No luck on the mini-trains, unfortunately. Caroline, Gigi and I headed out to the place where we'd expected to see them, and found nothing.



So, we continued our drive towards the south-west, crossing the ferry across the mouth of Pool's harbor. Corfe Castle was our next landmark, a really impressive ruin high on a goat-inhabited hill. The area was fenced off to keep tourists out of the area.



Next, we visited the Tynham village, a ghost-town near the coast. The British army needed a place to do live-fire exercises so they evacuated the little farming village and fenced in the area. After the war, they decided to keep the land, but allow visitors into the former-town center. It's amazing how quickly nature seemed to overtake these villages. There wasn't even a trace of thatch on the roofs.

I made sure to snatch a photo of some of the books that were left in the (maintained) single-room school house. I'll see if the university library has any of them in our stacks.



Around lunch time we came by a neat little pub, the New Inn at Church Knowle. This happened to be the first place we came across that seemed likely to serve a Steak and Ale pie. It turned out great. The food was excellent, and the pub has a big reputation. Almost all of the tables were reserved (impressive for a pub that's so far from any major town), and we were lucky to get a seat.

Finally, we went to see Lulworth cove. It seems that the British like to go walking on New Years Day as the area was packed. There's some nice scenery and a wonderful natural harbor.

Saturday morning started with a long run. I made it out along Forest Road and onto the trail in the woods. All in all, I think I did about 40 minutes of actual running. I can feel a definite improvement, and plan on going out tomorrow.

Saturday afternoon was spent having lunch with Gigi's friend Jan. We drove down to the sea and stopped at a nice little restaurant where I got a burger, and Gigi had a Thai-themed pizza.

Friday, January 1, 2010

England (Day 6 Week 8/24)

I left the US on Tuesday and had one of the smoothest trips I've ever taken. Before my flight left, United called me up to the gate sand said that they'd given me an upgrade to business class. On an international flight, business class meant I had a personal TV, a seat that could fully recline and some nice meals. We landed on time (Wed morning) in England and I found my bus with no problems.

Gigi and Lidia were waiting in Ringwood and saw me easily because of my bright yellow hat (though, they expected it to be pink). We drove into Burley and arrived at the gate house to have tea. The main house is coming along nicely and the new floors look great.

Wednesday afternoon we went to the Burly Inn for a late lunch with Lidia and Steve. Gigi had a shrimp cocktail, I had a curry, and we both had 'real ales' made by Ringwood brewery.

That night, we went to bed early as I hadn't gotten much sleep on the plane and was very tired.

On Thursday morning I showed off my culinary skills and made a breakfast of scrambled eggs. Gigi even had Creme Fresh in her refrigerator, exactly what I needed for the Gordon Ramsey scrambled eggs recipe. I love cooking on the Aga.

That afternoon, we called a taxi to take us into Burley to do some shopping. Gigi got a driver who she really likes, but says treats her like she's made of glass. We stocked up on food and then walked around the downtown.

After we got back, I went out for a 30 minute run along Forest Road. So, my half-marathon training is not totally being neglected.

New Years eve dinner was pasta with a meat sauce. I was very happy to see that my homemade spaghetti came out correctly, as did the red sauce. For dessert we had cider and chocolate.

Today, we're planning on going out with Caroline (Gigi's hair dresser) for a drive, and hope to encounter the society of people who make very small steam powered locomotives. Think something very much like a steampunk lawnmower!