Last year I added Boost::Spirit to my MUD project. A few weeks ago I learned that all of the work I had done was deprecated in the new Spirit 2 library. I could still use "Spirit classic," but it is deprecated and may be removed at some point in the future. So I spent some time today figuring out how to convert my grammar rules.
For example, in Spirit classic, I had this rule to handle the most complex rule for my get command. In this case, it handles a command like get 20 items 2 from container 3:
rule6 = int_p[assign_a(mNumberToGet)] >> ' ' >>
(+alpha_p)[assign_a(mItemToFind)] >> ' ' >>
int_p[assign_a(mItemNumber)] >> ' ' >>
str_p("from") >> ' ' >>
(+alpha_p)[assign_a(mContainerToLookIn)] >> ' ' >>
int_p[assign_a(mContainerNumber)];
which could be tested by the following code: if(parse(str.c_str(), rule6).full)
Here is the equivalent code in Spirit 2
std::string::iterator first = str.begin();
bool r = qi::parse(first, str.end(),
(
qi::int_ >> ' '
>> +(~qi::char_(' ')) >> ' '
>> qi::int_ >> ' '
>> qi::lit("from") >> ' '
>> +(~qi::char_(' ')) >> ' '
>> qi::int_
),
mNumberToGet,
mItemToFind,
mItemNumber,
mContainerToLookIn,
mContainerNumber
);
if(r && first == command.end()) {
return true;
}
In many ways, the new Spirit 2 library is better, and purports to be much faster as well. The parse function has certainly been made somewhat more convenient. Overall, I'd rather not have had to spend time on this, but the only other option is to lock in with an old version of Boost that may hamper me in the future.
- Got about 4 hours of sleep last night. Really dragging this morning. #
- So tired. Two sleepless nights in a row. Can't function. Napime. #
- Wrapping up some work in Qt. Eating lunch at the same time. Mmm, lunch. And it's #towelday Don't panic. #
- Burritos for dinner tonight. Believe it or not, the home-made flour tortillas were the tastiest part! #
- Slept better last night, but only by a small margin. Still pretty tired. Too much pollen in the air. #
- Woo! Cookies in my office! #
- M is for the Mortgage you'll take out to invest in your new belief system. #ScientologyABCs #
- On the phone with insurance company trying to straighten out their uselessly non-descriptive billing... #
- Hiding in my room typing on a laptop on my bed. Wife's got a bunch of friends over. Too...much....estrogen... #
- Time to delve into some #MUD development. It's been too long. #
- Why, boost::spirit, why??? Why did you have to change?? Just when I figured out all this EBNF grammar stuff... #
- Wife's party is still going. I'm getting tired. Almost figured out the new boost::spirit::qi stuff. Maybe tomorrow... #
- Coleman in a coma I know, I know, it's really serious. #garycoleman #
- Got my head down trying to both start and complete a task today. #
- 400 lines of code later, I begin testing. Hope it works. #
- Knocking off early. It's been a heck of a day. #
- Fresh loaf of sourdough just came out of the oven. It smells great! #
For the last three nights I've had trouble sleeping. Every night I lie awake for hours in a semi-conscious state something like I imagine meditation to be. Last night at 3am I finally got up and took some Tylenol PM hoping that I would sleep some. I woke up at 7. I can only hope that tonight I'll be so tired that I'll fall asleep quickly and sleep all night, though somehow I doubt it'll be that good.
- RIP Ronnie James Dio. Rainbows In Peace. #
- Dio all day long #musicmonday #
- Our software distributor just bought our biggest consumer competitor. Seems like a conflict of interest is in the works... #
- At local chamber of commerce to heat about a local business trip to ä¸åœ‹ #
- At 37, I believe I'm the youngest person in the room. So far it looks like a flimsy excuse to take a personal holiday on a company budget. #
- So much for starting on time... #
- The price for the trip to Beijing and Shanghai was pretty good, but not much of a business thing. Didn't know the CoC was in to tourism. #
- Writing more code today. It's a good thing I've written a tight C++/MySQL wrapper, it's going to get used a LOT. #
- No can has more drama please. #
- We just ran our 1337th Perforce checkpoint. w00t for 1337! #
- Watching the latest episode of V on Hulu. #
- There's only one word for the most recent episode of V: Burnination! #
- Can it get ANY better than @neilhimself (Neil Gaiman) writing an episode of Doctor Who? Only if he writes an entire season. #
- I thought they were new Godzilla enemies, turns out they're the next Olympic mascots: http://bit.ly/8YGFJ0 #
- Got home 20 minutes ago. Bills are paid. Twitter is checked. I should look at the dishwasher, but I'm tired and just want to relax. #
- "I know about the holograms." Could you make stuff up that's funnier? http://bit.ly/axCkka #
- I consider myself to belong to the Sad Panda Political Party. There should totally be one of these... #
- Making a 4 gallon batch of pizza sauce. We're going to can it for later. Saves time when you have a great sauce all ready to go... #
- Sauce is done simmering. Added olive oil and fresh basil, salt and pepper. Tastes fantastic. Going to make pizza tonight! #
Last night we went to the Texas Roadhouse for dinner. Normally I'd link their website, but due to the gratuitous use of Flash I'll leave that to you if you want. TR just opened up a few weeks ago in Coeur d'Alene.
Even with reservations, it took us over an hour to get a table. Be ye warned. But there are barrels of peanuts from which you may graze. They also encourage you to throw the shells on the floor so the busboys have more work. So even where you sit, there may be a layer of peanut shells crunching underfoot. If you have a nut allergy, this is not the place for you.
The bread is great: fresh, hot, and sweet. And it comes with cinnamon butter. Between that and the peanuts, you could probably order a side salad and leave full. I took half of my dinner home in a box. The pulled pork wasn't pulled so much as largely chunked. And the "fall-off-the-bone" ribs did come apart easily, but I've had better. The service was okay, but nothing stellar. They stop every now and then to dance, too. Some kind of weird, kick-the-peanut-shell and clap-your-hands shuffle.
To top it off, they blast country music into your ears the whole time you're there. Overall, it's not a place I'll be going back to, but if you're a beer swilling, truck driving, country music-loving redneck you'll probably love it. I'm none of those and left with a headache.
On Monday my wife, brother, and I went out to see the new Robin Hood movie. I was interested in it because Alan Doyle, the lead singer from Great Big Sea is in it. Turns out he's a friend of Russell Crowe, who got him into the part.
The movie was all right. I went in with certain expectations (it is Robin Hood, after all) that were never met. The Sheriff of Nottingham had a very small part. Think of it more like a Robin Hood prequel and you won't be disappointed.
Keep your eyes out for Alan. He's the archer that sings all the time
I've not been writing much lately, the mild winter has combined with the warm spring to produce unholy amounts of pollen. Even a walk from my car into my office makes me suffer.
Every time I run my dishwasher I've seen water leaking out from beneath it, so I took it out yesterday after work to examine it. Except for the connection to the hot water (under the sink) everything looks fine. I ran it through a cycle while empty to see if I could find where the leak comes from and it didn't leak at all! Now I'm really confused. The time previous it leaked a gallon (I'm not exaggerating) on to the floor. I suspect there is an issue with the hot water hookup, but didn't see near so much water leak out this time. I'm going to run it again tonight if I have time. My in-laws' computer is acting up again.
I started watching The Day of the Triffids last night (the 1981 BBC TV version). I get the feeling this is another one of those "the book is way better" stories, but it definitely has its good points. It's creepy in an apocalyptic sort of way. It's only a miniseries, so I'll be done soon. I'll let you know how it goes.
- Finished reading House of Suns by Alastair Reynolds. It was fantastic! #
- Just downloaded the @PeppermintOS One release. Took less than 10 minutes. Can't wait to try it out! #
- Just finishing up eating a 1.2 pound Fuji apple. I'm stuffed with apple bits now. #
- Almost hit some old d-bag that was standing in the middle of the road gawking at an accident. Retard. #
- Playing Zombie Dice from @sjgames. My wife is a very lucky roller... #
- Wife rolled 3 green shotguns in one throw! I win! #zombiedice @sjgames #
- Catching up on paperwork. It's not as fun as it sounds. #
- Really enjoyed #w00tstock at PDX, but @Aladdin_Theater: Can you please *****ing lower/tilt your projector so the lights don't interfere??? #
- Mmmm, SQL Queries. I should be finishing my code, but I've got to help out a coworker with a complicated query first.. #
- Uncommonly frustrated after I told someone a bug was a duplicate of a previous one and they responded "no it isn't." It's MY code, I know!!! #
- Portal, for free, on the Mac? Why thank you, Steam, I think I WILL try it now! #
- Aside from my work laptop, I have no Windows machines at home anymore. Just Linux and Mac. #
- Dear Sun: I don't EVER want to install the Yahoo toolbar when I update Java. Quit defaulting me to do so. #
- It's been a quiet day. That's because I've been working hard. Finished up fixing several bugs/feature requests! #
- Just saw another TV commercial that said "backslash" when reading a web address. When will the idiots learn? #
- My stupid dishwasher is leaking water like a sieve. #
- Breathe deep kiddies, it's my day off. Well, technically it's my WEEK off. See you round! #
- Refreshed my sourdough starter and put it in the fridge. Won't be back for a week so there it will stay. #
- I really should pack for the trip, but I've been watching Hulu instead. And listening to the wind batter my house. #
- Chocolate fountains are good. But I believe a peanut butter Nutella fountain would be better! /via @Sullengrey No, it would be the BEST! #
- Happy anniversary to me! Oh, and my wife, too! #
- The rain stopped, it was light and short-lived. Perfect! #
- Weird hours for shops when I'm on vacation. What's up with that? http://yfrog.com/b8i65nj #
- Made some excellent pizza tonight, all from scratch. http://yfrog.com/5guhcj #
- My wife at Depoe Bay, taken yesterday. http://yfrog.com/0e53loj #
- The harbor at Depoe Bay really is small! http://yfrog.com/0r2raoj #
- Made deep dish and regular pizza tonight. I'm a pepperoni purist, my wife loves sausage mushroom and olive #
- Going to #wootstock Portland tomorrow, getting some spoilers from tonight's Wootstock from @wilw
# - Or is the hashtag supposed to be #w00tstock #
- Slept in until 6:30! This is the latest I've been able to sleep my entire vacation! #
- Got my UUID generator working fine now. Need to fix a local Boost build issue though. #
- #1 reason not to do laundry at your parents' house: you may see your sister's thongs. #
- Oh Boost::Spirit why did you have to change? All my stuff is "classic" now an I've had to fix a wacky header problem already
# - Waiting in line for Portland #w00tstock #
- Wore my "Lincoln Shot First" tshirt for #w00tstock #
- The line is slow, but it *is* moving. #w00tstock #
- Just coming round to the front side of the building. Tons of geeks here #w00tstock #
- All general admission at #w00tstock Web though tickets have seat rows and numbers. We picked ours in the back! #
- Seated and relaxing at #w00tstock Yes, it's totally sold out. http://yfrog.com/6rpenjj #
- If you could harness all the brainpower here we could solve the world's problems. #w00tstock #
- If you could harness all the extra weight you could feed thousands. #w00tstock #
- I've lived for 37 years and all I got was carded to get in to #w00tstock #
- My wife and I met @wilw last year at pax, he's a super nice guy and you should buy anything he's selling. Plus, don't be a dick #w00tstock #
- MAKE IT START!! #w00tstock #
- Dear aladdin theater, the cd is skipping. Plz fix. Kthxbai, <3 devlyn #w00tstock /via @devlynpdx So that's what that noise is.. #
- #w00tstock ceiling cat!! #
- Best time EVAR! It's intermission now and @wilw pwned. #w00tstock #
- #w00tstock comes with an extra helping of Ceiling Cat http://yfrog.com/g0r8wrj #
- The sound guy's shirt says "Don't Piss Off the Sound Guy" on the back #w00tstock #
We had a blast today, and I don't know when I'll be back to having a regular Internet connection so I'll fill you in on tomorrow's plans.
In the morning, we're going to go on a whale-watching cruise out of Depoe Bay. Then we're going to meander up the coast and check out some tidepools, then hit the Tillamook Cheese Factory. Oh yeah. Because we're all about the cheddar. Then we'll be on our way back to Portland.
I took some fantastic pictures of the animals this morning at the Safari Park. I don't have a good way to sort and edit them until I get home though, so you'll just have to wait.
I think we walked at least four miles on beaches today, too. My feet are killing me. Fortunately, we brought our Wellies and didn't get any sand in our shoes. They also let us go in to the water a ways, which is why we like them.
Waking up and hearing the ocean is a wonderful thing. I'm sitting in our suite in a Best Western in Bandon Oregon (Inn at Face Rock). We left Eugene (okay, technically Creswell but I don't expect you to know where that is) yesterday at about 5pm. We drove the back roads to Florence and decided to turn south instead of north this time.I'm glad we did. Our first idea was to stop in Coos Bay, but it wasn't much of a destination, so we kept going. We ended up stopping here in Bandon. It's not much of a town, at least what I saw of it last night, but it's nice. I've been having spotty cell service all along the coast (no surprise there), but the Best Western has free Wifi (w00t!).
When we checked in we found out that the receptionist was from Idaho and when we mentioned today is our anniversary she upgraded us from the normal room to the honeymoon suite! And sweet it is. Not only does it have a fantastic view of the ocean, it also has a fireplace and a jacuzzi tub big enough for at least three people. The bathroom (the one with the shower, there are two bathrooms in this suite!) is tiled with Italian stone, it's gorgeous stuff.
We had dinner at Bandon Bill's Seafood Grill, and (as usual) I had the fish and chips. They were above my par for fish and chips, though not the best I've ever had—that honor still resides with England, and more specifically a chip shop in Bath. We sat and at and watched the sun set over the beach. Then we walked down to the beach, but it was windy and cold. The tide was coming in so we took that as a cue.
The bed is firm, as I like it, but has a pillow top that feels extra soft. I don't think I so much as rolled over all night. Now I'm kicking back and listening to the ocean, plus a few cars that pass by. It is lightly raining now, but I won't let that spoil my wonderful morning. After breakfast, we'll leave the "westernmost Best Western in the continental US" and head over to the West Coast Game Safari Park for a Walking Safari. We had no idea there was such a thing on the Oregon coast! It's also a "Petting Park" and they have the cutest leopard cubs on their front page, go see it!
Afterwards, the plan is to head back north until we want to stop again. This is the life. Once we hit Tillamook we'll turn towards Portland but I don't know if that'll be today.
This week Lorien and I are going on a mini-vacation. We're leaving home and driving to Portland, which is perhaps our most common "vacation" spot. But we won't stop there! We'll visit my grandparents near Eugene, and drive up the coast to try to have the most relaxing time possible. Sushi will be consumed, and places will be visited. Our plans include the Tillamook Cheese Factory and Bob's Red Mill. I think we might even get roped in to babysitting. Woot! Oops, I think I got a little too excited for that last bit.
- Must..watch..new Doctor Who... arrrggg! #
- Wow. The Doctor Who Weeping Angels still creep me out. #
- Just lost the USB ports from ANOTHER MSI motherboard. That's 3 or 4 now. Those things are CRAP. #
- Latest Doctor Who was brilliant, especially the bit about the parking brake! #
- Glad I don't live in Mississippi. Those people talk funny. #
- Tired. Need more sleep. Is it lunch time yet? #
- I'm running on a serious lack of sleep today. This is not good. #
- Boss wanted to work on some Windows permissions issues this morning. Haven't seen him yet and it's nearly 11am. #1hourtogo #
- Today's Email: "Specially; I want to thank you for your modesty and focus as a custumer representative." #
- Today's Email: "Hopping the president of your company, in a closer future, may appreciate your increduible acctitude to the customers." #
- Today's Email: "representatives like you, is the stand of any company." #EngrishFTW #
- Just received a box, which contained another box, which then contained three boxes. #hoorayforcardboard #
- Sarah is really quiet today. #
- Had to install Rake on a server. Took 5 seconds: 'gem install rake' in the shell. I wish all tech worked this easy.. #
- I'm SO ready to go home. It's been a long day of work on little sleep. #
- I have this strange compulsion to book a chartered fishing trip in the Pacific. Probably shouldn't act on it right now. #
- Frustrated with Windows 2008 R2 certificates for remote desktop. This is WAY more complicated than it should be. #
- Gaaaaahhhh! Windows is retarded. #
- Dear Apple: Don't accuse others of not being "open." You have no room to talk. #
- Almost 700Mb of updates to download for OS/X today
# - Follow @Drobo + @Photojojo TODAY & RETWEET to win your NEW Drobo! #
- Last day of work before a one-week vacation. Believe me, it's much-needed. #
- Had fish tacos for lunch. First time I've ever had fish tacos. They weren't bad. #
- Home stretch! Last 15 minutes! #
- Two hours of racquetball and my quads are killing me. I'm officially getting older. #
