You don’t want to see the after.
You don’t want to see the after.
I was looking to split a string on case changes today, and googling that problem didn’t turn up much. Here’s my implementation via a category. I hope it helps someone.
@interface NSString (Extensions)
- (NSString*) spacify;
@end
@implementation NSString (Extensions)
- (NSString*) spacify
{
// ignore irrelevant strings
if (self.length < 1)
return self;
NSMutableString* result = [NSMutableString stringWithString:self];
// create a range starting after the first character
NSRange range;
range.location = 1;
range.length = [self length] - 1;
// match any uppercase character
NSRegularExpression* r = [NSRegularExpression regularExpressionWithPattern: @"[A-Z]"
options: 0
error: nil];
// replace matches with the match preceded by a space
[r replaceMatchesInString: result
options: 0
range: range
withTemplate: @" $0"];
return [NSString stringWithString:result];
}
@end
Ever since I finished college and started working desk jobs, my weight has gone up gradually. For the first several years, this was a good thing. 5’10″, 145 lbs was not quite an attractive physique. When I met Amy, I was at 164 and pretty fit – exercising regularly.
By the end of last winter, six and a half years later, I was at 187. I didn’t look that good and I didn’t feel that good. When my ultimate league started up in May, I couldn’t keep up with anyone. Shortly after that, I had my annual physical. I know BMI is a rough estimate at best, but the chart on the wall had me square in the middle of the overweight classification. When my blood work came back a week later, my cholesterol was (borderline) high for the first time. I was ashamed. I was also determined to turn it around.
I’ll save the suspense and report that by this weekend I’ve successfully lost 23 lbs. I’m back to 164, and I’m at least as fit as I was 7 years ago. This is how I did it, most of it is pretty basic:
I’m really happy with my progress here. Now that I’m at my goal, I intend to maintain the exercise level and better diet, while reducing the punishment as long as I stay under 165. While I don’t think I need to lose any weight, I would like to lower my body fat percentage. I feel a lot better, and I want that to continue.
I was first introduced to sailing when my father rented a Sunfish on Lake Phalen. My faded memory doesn’t recall a successful afternoon, but who knows? After that, I spent some time on his sailboards, and I always liked that while wanting for more control that my skinny teenaged body could muster.
A couple of summers ago, I took the sailing class offered by the Minneapolis Park & Rec board. That was a lot of fun as well as a good learning experience that I’d recommend to anyone. The same summer, a friend took me out on his catamaran on Mille Lacs Lake. We were cruising along pretty well, but found ourselves turtled in the very middle of the lake. The proper righting gear was not in place, and it seemed we might be stranded there all night. Not a boat was in site, and the middle of Mille Lacs is a long way from shore – not swimmable. We eventually recovered, but I have to admit it was scary.
Recovering from scary adventures is something I evidently enjoy, as I couldn’t wait to join the sailing club. After two and a half years dominated by grad school, I was excited by a summer free from school. Even better, I hired a lawn service. Looking for a fun way to fill that time, I’m really grateful that I found the Twin Cities Sailing Club.
The club is an awesome group for learning to sail and socializing with other like minded sailing enthusiasts. I’ve gone from being pretty green to “Skipper” status in the club: I can take out any of the clubs sixteen boats whenever I’d like. In return, I help other new sailors and join the club in maintenance days on top of a very reasonable membership free. It’s been great, and I look forward to many more summers spent sailing with them.
In the meantime, I’ve been enjoying a few adventures on my own. A couple of Fridays ago, I took Amy and Jake out on a C-Scow, a larger scow that I hadn’t previously skippered. I’d sailed the smaller MC-Scow many times, and this didn’t seem fundamentally different.
We enjoyed a few passes across the lake in lighter winds. In hopes of squeaking some more speed out of those slower winds, I asked my wife and nephew to sit on the leeward side of the boat to help us heel out of the water, reducing drag and letting us move faster. This was the key mistake on my part. An experienced crew would have been fine in that position, but once there it becomes very important to watch for coming gusts and shift weight accordingly.
A large gust came along pretty soon after that, and before they knew what was happening, the boat was on its side. I checked to make sure everyone was OK, and then reassured them that things were fine and that this happens from time to time. I’d done several capsize drills with the club, and I knew what to do in general. Unfortunately, I didn’t know what to do specifically for a scow. The capsize drills were all done on Catalina Capri 16.5s. The C-Scow is a different beast, and after a few attempts to right her, it was clear that I just didn’t know how.
A lot of helpful sailors turned up to give us a hand, but despite their best efforts we ended up swamping the boat. Around this time, I noticed some commotion at the nearby beach. There were, at least, one large firetruck, two police vehicles, and two ambulances waiting on shore along with a crowd. I saw this and said, “Oh man, tell me they’re not here for me.” Someone broke the news that they were. Despite our clear safety and the plenty of boats there to help us, someone on shore called 911, and the entire cavalry showed up. A police boat came out to meet us on the water, and there was another waiting on shore. They didn’t actually help us… just added to my mounting embarrassment.
In the end, a nice family helped us tow the boat to the beach where some club members and I were able to bail it out and get it seaworthy. I’m indebted to them and also to the experience as a whole. I learned a valuable lesson in crew assessment and scow handling in general, and we all walked away from it safely if a bit wetter than intended.
That’s a terrible blog post title, I know. Nevertheless, I just burned 90 minutes trying to figure out why a simple Spring MultiActionController setup left me with an error: “No request handling method with name ‘list’ in class.” Google was little help, so I resorted to Bing.
Eventually, I found a buried forum response with my exact problem, I had referenced the wrong package’s type! If you’re running in to this, make sure you do this:
import org.springframework.web.servlet.ModelAndView;
and not this:
import org.springframework.web.portlet.ModelAndView;
This will teach me to be more mindful of what Eclipse decides to add for me automatically.
The snow this year is driving me nuts. This is from the first of this season’s two “20-year” snowfalls, back when it was cool. Back when it could still possibly look pretty.
Sharing is not really my strong suit, so I was excited when Ryan sent me this link to Ben & Jerry’s Pint Lock. Fast forward to a few shipping days later, and Amy found this upon opening the freezer door to steal some of my ice cream… and she thanked me! Win-win.
Not having wanted a dog in the first place, I was surprised by how hard I took our loss of Maeby last March. In her too-brief 22 months with us, she really endeared herself. She had tons of personality, and we will always miss her.
We (Amy) adopted our new beagle, Lemon, in May – tomorrow marks three months. Hoping to have more years together this time around, we went with a younger dog – she’s probably about ten months old. As the video above shows, she can be a lot more challenging that Maeby was, but I think hope as she gets older, she’ll be just as fun.
File this under “Good Things to Know if You Own a Home”
Never store grass seed in plastic bags in your garage for the winter!
I took advantage of the today’s relative warmth by getting lots of stuff done around the house. Near the top of my list was cleaning the garage. I opened one of the cabinets above the workbench, and I was very confused to see grass seed, plant food and shredded paper all over the place. Even more confusing was all the crumpled up paper spilling out of my crumpled up leaf-blower bag. Very explanatory and startling was the mouse that popped its head out the bag to see where all that light was coming from.
When I finally went back and opened the cabinet again (with my golf club), several mice scampered off. I gave the leaf bag a few pokes with my pitching wedge, and even more ran out. I contemplated leaving it, but soon enough my to-do list was topped by “remove the mouse nest from my property.” I wish I had taken pictures, but the only thing on my mind was getting rid of that mess. It looked and smelled like an unmaintained hamster playground. Gross!
Continuing Lifehacker‘s series on how to eat food, they posted this video on the right way to eat chicken wings. Awesome!
Pardon the relatively technical post, but I want to document this problem somewhere in hopes that it saves someone the frustration it caused me.
I’ve been experimenting with iPhone development lately. For the most part, it’s been a fun learning process despite the quirks that Xcode, IB, and Obj-C throw at an MS developer. Objective-C is, at worst, a 20-year-old hack that follows few conventions established by most other OO languagues.
My most recent lesson has been adapting my project to use Core Data for persistence. Early on, I kept receiving the error “message sectionOffset sent to freed object” when trying to load a connected table.
I found the solution nowhere online, and the exception is not at all helpful. For me, the problem was that I was trying to access the FetchedResultsController before performFetch had been called. Adding performFetch to my viewDidLoad fixed the issue, and I was on my way. My iPhone app is on its way.
I know I’m way overdue for a blog post. Grad school on top of a full time job has kept me very busy to say the least. Nevertheless, I saw the following video today and had to post it. I’m always interested in technique, and I always love learning new ways to do things, especially better ways. With that in mind, this post on Lifehacker floored me. I need a banana now!
It was a great trip. Fantastic weather, really good snow, no injuries, and my favorite part about Big Sky: no lift lines. The interns, as Ryan dubbed them, did really well. As predicted, I certainly had my work cut out for me just trying to keep up.
We got a lot of fun pictures too. Mine are here; Ryan’s are here. My favorite has to be this shot by Ryan. On the afternoon of the last day, we split up for a while. The boys headed to the terrain park while Ryan and I rode a couple blues we hadn’t seen yet. Our timing was perfect, because our next lift ride took us right over the park while Ben was making his run. He hit the C-box perfectly, and we were able to snap off some aerial photos. This all happened without any coordination.
I already can’t wait to go back, and the interns will be more than welcome when they’re ready for their true apprenticeship.
I’ve always loved this picture, taken of my brothers Ben and Joe before their first snowboarding lesson. The total lack of enthusiasm on Joe’s face kills me. In 2003, I had the pleasure of teaching them how to ride. It was a struggle at first, but by the end of the day, they were both riding, turning, and stopping on their own, carving up the blues at Afton Alps. They’ve both become good riders, and I’m proud to have been a part of that.
Six years later, I feel very lucky to be able to bring them along to Big Sky this weekend. It’ll be their first exposure to real mountain snowboarding. I’m sure this time it’ll be me who struggles to keep up, and I’m hoping they’ll teach me a trick or two. My FS 270 needs work. This time, I’m assured that they’re very excited, and I hope to post a successful “After” picture soon.
I’m generally no fan of Apple. Their marketing is so frequently filled with lies. The Mac v. PC ads are impossibly smarmy. And the Apple Stores: the retail employees are either so uninformed or so blinded by corporate idolatry it makes me ill. (Don’t get me started on the so-called “genius” bar.)
Mac OS has its moments, but for every cool feature (Exposé, Spaces), there is as much awfulness (menu bar, Finder, window management, keyboard shortcuts). If you really think it’s any better than Vista, it’s probably time to put the Kool-Aid down. And the dev environment, Xcode? What a usability nightmare.
But I’ve certainly been a fan of their hardware ever since my 3rd-gen iPod. Their computers, phones, and media players are certainly the best looking around, and they always seem very solid. With that in mind, curious about iPhone development, and needing a laptop for grad school, I made the plunge and bought my first Mac – a refurbished MacBook Pro (MBP). This was in September.
Three weeks later, conveniently past the return period, Apple announced a new line of MBPs that were much cooler than mine. On top of that, mine started making a really high-pitched noise at medium brightness in Vista. Two separate repairs by the “geniuses” did nothing to fix the problem, and the laptop was beginning to show signs of having been taken apart and reassembled by non-experts.
Here I was seemingly stuck with an “obsolete” machine that made my ears ring and didn’t nearly shine like it had only six weeks ago.
So I was elated yesterday when I called Apple to pursue a third repair or possible exchange. After only a few minutes on the phone with customer service and a few more minutes on hold, they gave me an exception to the return policy – I’ll be getting a full refund for the “old” one. I was really impressed by this; kudos to Apple on a great “make good.” My new MBP is already on the way.
Happy second anniversary to my sweet Sugarpop! It keeps getting better.
I had PRK surgery done two years ago, and my vision has been fantastic. I’ve generally been pretty comfortable, but every once in a while I’ll wake up in the middle of the night and my eyelids will be stuck to my eyes. Opening them quickly before I realize this is then very painful.
It happened again early Sunday morning and my right eye still stings today. I saw Dr. Croissant (his real name), and he explained that it’s not uncommon and nothing to worry about. I have a “recurrent abrasion.” My eyes are dry, and small areas of my cornea are not totally healed since the PRK procedure; this is normal. The dryness makes my lids stick to those healing parts of the cornea and then pull them off. I’ll be using a salve at night for a while to keep the eyes lubricated until they full heal.
Before I begin, let me clarify that I really enjoy Vista and Windows Media Center (WMC). Don’t let my recent purchases fool you, I haven’t become a Mac, and it doesn’t look like I’m going to. WMC combined with an Xbox 360 or other Media Center Extender (MCE) provides an awesome television viewing experience, especially in HD. With the issues ironed out, it’s been working fantastically for a couple of months now.
However, my experience with it hasn’t been without its problems. The problems themselves wouldn’t have been so bad if they had been well documented online, but they weren’t. This post exists so that hopefully someone else with the same problems can save themselves some of the swearing I’ve been reduced to.
I had used WMC on my old PC (and extended via the 360) without issue, so when I build the new box, I was pretty excited about seeing it all in HD. You can imagine my disappointment when I fired up the MCE on the 360 to try it out, seeing the great picture only to get an error message telling that WMC couldn’t connect. When I went to the PC to investigate, it was totally locked up. Not like a program had crashed… not like a blue screen… not rebooted… just totally frozen. Nothing to do but turn it off and back on.
This seemed to happen every time I used the extender. Sometimes it would happen immediately after the MCE started, usually it would happen 30 seconds or so in to watching something (live or recorded). Occasionally it would happen after 30 minutes or more of fine performance – this was the most frustrating, as it would seem that some tweaking I had tried had fixed the problem.
Solution: It turns out that this freezing has something to do with the onboard network card of my P5K motherboard, either the hardware itself or the drivers. Strangely, simply adding another network card did not fix the problem. I had to to remove the drivers completely and disable the card in the BIOS settings. After doing that and installing a new network card, this problem has gone away.
I felt great when the total lockup was solved, but that didn’t last long. Soon enough I began to get the “application has launched UI unexpectedly” error from the 360 when trying to launch the MCE. I would reboot, and occasionally that would fix the problem. I also followed the steps in this Microsoft knowledge base article; that seemed to fix the problem too, until a week later when it happened again. Reapplied the steps, problem solved… until a week later when I was trying to demo my sweet setup to a friend… boom. This time reapplying the steps several times did nothing, and I was ready to beat my head against the wall when I saw the annoying “low battery warning” from my mouse driver pop up.
Solution: Duh – that was the unexpected UI! I checked the Startup folder for all users and sure enough, the mouse driver shortcut was there. When someone starts a MCE session, it runs as a separate user on the computer, logged on in the background. So that user was effectively getting the low battery warning with no way to handle them. I moved all the shortcuts from the “all users” startup folder and put them in my own startup folder, and I haven’t seen this happen since.
I hope this helps someone. If so, let me know!
You have to love the Daily Show. Thanks to Kari for sending me this.
(Warning: links from this post might be gross, just remember that they’re all just cake.)
Thank you so much to Patrick for telling me about Cake Wrecks. My day is made. Nowhere else could I learn about both a delivery cake and a foot fungus cake along with priceless examples of stupidity.
I love Google Maps. Creating a map of hotels and bed & breakfasts we’re considering for our upcoming San Francisco trip was incredibly easy and fun, and now it’s super useful.
This sporadic blogger feels the need to post something, despite any specific news. So summer’s been going well. Our patio and grill have seen a lot of use with some thanks to Christin & Lyric and the Kesslers. Maeby’s been keeping us active, and both the dog and I are a few pounds lighter for it. I’ve been having a lot of fun with my new toy, my reading list, new things to study, and some old-school gaming.
My camera has been getting a lot of work as well, but a lot of that still sits on my computer awaiting “post-processing,” otherwise known as deleting, deleting, deleting, cropping, sharpening, and “I’m Feeling Lucky.” So when I finally get through that, there will be photos to enjoy of our continuing summer adventures, including grilling with the Bears, Minnesota wine country, and fun times at Lake Kjostad.
We also recently decided to take a long weekend in San Francisco. Amy’s wanted to go back there as long as I’ve known her, and I’m excited to see it for the first time. If anyone has any travel tips for us, let me know.
There Will Be Blood was one of my favorite movies from last year. My brother liked it as well, but I don’t think I know anyone else that did. It certainly insists upon itself… but it does so wonderfully. Incredible acting, beautiful cinematography and direction, and a really cool, creepy, slow feel.
At any rate, I want just bought this t-shirt.
Thanks to Patrick for posting this amazing link. I won’t say anything more for risk of ruining the surprise.