Saturday, March 9, 2013

AutoMapper from a List to Class Properties

I just found AutoMapper, a tool I wish I'd had years ago. This can take any of you classes and translate them into another class. This would have been especially useful when I've had to get an object out of and EntityFramework, and add in additional properties before display, which happens quite often. The code for this is pretty simple, an well defined on their site.

I came across AutoMapper from my wife last week, and found it to be a perfect fit for on of my current issues. We're getting data from a Web service that has an Object and a lit of properties with their values, like the following.

I needed to easy map each property to my display object type. There is the option of using reflection (Looping through Object's properties in C# is an excellent example), and looping over each of the properties in my destination object, and filling them from values in the source object. Honestly, I did head down this path a bit, but realized I needed a more flexible solution.

It turns out our Web service may change in the next year or two where it returns properties in the same way my display object uses properties, but may have different names. AutoMapper makes it easy to put the translation logic in one place, and changes in the future will be minimal, and all take place in one location.

I'm now using the following to make the mapping work pretty easily:

The AutoMapper configuration should occur I one location, such as application start. Once we switch the Web service, the mapping can remove the specific property names, and only cover the properties where the display property name is different from the data source.


Friday, March 8, 2013

Dry Ice

What does Dry Ice evoke in you? For me I remember clearly selling popsicles at my middle school Fall festival and being reminded constantly not to touch the dry ice, sine I would burn myself. How could ice burn? At some point I did touch my arm, and man it hurt. At the same time, this was the greatest stuff ever, ice that didn't melt into water, and that could burn. Is there anything it couldn't do? Heck, I just read an article about the Orbit, a portable washing machine that is in development and uses dry ice to clean clothes. It also smokes and makes crazy awesome bubbles in milk and soda.

About last Spring I started following the Penguin Dry Ice blog. This s a great place to get information about how you can actually use dry ice. For example, it's a great alternative to regular ice for any coolers, so long as you separate the ice from the food. I had food on top of the ice, and it froze. Turned into freeze dried fruit.

I'd never considered it before since I assumed it was expensive. But, turns out dry ice is about $1 per pound, less than the cost of regular ice in the store. On top of it, 5 pounds of dry ice is much smaller than 5 pounds of regular ice.

You can get it at most grocery stores. All of our local Harris Teeters have it, but you need to show ID and be over 18 to get it.

So, with it being so great, here are the down sides:
  • It only lasts about 24 - 48 hours in the freezer. So you have to buy it about when you plan to use it.
  • It can burn, so it's not for kids to use.
  • You can't put it in a cup as regular ice. It turns into carbon monoxide, which won't kill you, but can give you a headache. You can put you cup in another cup, and have the second cup with dry ice.
It's definitely worth trying out dry ice. It was excellent for our last camping trip.


Thursday, March 7, 2013

Potty Accidents

While we still struggle with accidents, we've tried a lot of different ideas, therapists, doctors, tests, anything. While we still haven't nipped this in the bud, we do seem to be making progress. A lot of this is thanks to reading It's No Accident: Breakthrough Solutions to Your Child's Wetting, Constipation, UTIs, and Other Potty Problems by Steven Hodges and Suzanne Schlosberg.

It's no secret, they believe most (almost all) kids who have accidents at night or during the day are due to constipation. More specifically, our kids aren't getting enough fiber in their diets (all kids really) and so a lot end up with poop stuffed all in the their colon and the intestines, never really clearing out. So even though kids poop daily, it still doesn't ever clear out.

We haven't gotten to doing an enema or Miralax yet, we really need an X-Ray anyway and to see the doctor again. But adding fiber has definitely made a different for both kids. If you are jut beginning potty training, or still having accidents, I can't recommend enough how useful this book was.


Wednesday, March 6, 2013

Best Free (or really cheap) Activities in DC

Growing up in DC, I had a LOT of time to wander the city, by foot, car and Metro. Here are some of the most memorable things I recommend everyone does. I still don't get tired of doing them.


It wasn't until College when I spent a semester in London that I realized all museums were not free. This is because everything at the Smithsonian is free. It is, without a doubt, the most complete education you can get for free. History, Culture, Art, Nature, Space, Technology... everything is covered. And it isn't just pictured on the walls, they have activities for kids, family and adults all the time.

While there are obvious options, like the Zoo or the Natural History Museum, I and my kids definitely recommend the following places to visit. The kids are still talking about some.

Natural History Museum

I know I mentioned it as obvious, but I can't overstate how incredible this place is. You should definitely check out the insect exhibit, with LIVE insects. They also have a great butterfly exhibit, but you have to get tickets for a set time. You could spend days seeing everything.


The Hirshorn Museum is the best lace for anyone even slightly interested in art. They have a lot of modern art, but also exhibits that will really change your way of seeing the world. Colin and Rachel were really taken by the Andy Warhol: Shadows exhibit, where a painting of the same thing was done in 100 panels, all with different color or lighting. Colin, at 4, wanted to get home so he could color one himself. Rachel wanted a picture of a metal doll, so she could draw it. They were both so taken by the art that they wanted to make it themselves. It was incredible.


I bet you don't even know this exists. The Sackler gallery has Asian art, with another museum across the garden for African art. What's always interesting about these is that the museum entrance is above ground, but the rest of the museum is set like a silo down 60 feet or so underground. While the exhibits are good, the real difference with the Sackler is that they have a lot of events for kids and families. We went with the in-laws and kids and spent 2 - 3 hours jut taking stamps of the word Love in different languages on Valentine's day in 2012. It doesn't sound great, but it really is an amazing time.


The Holocaust museum always changes my outlook on what we can do as humans. It will be the most depressing thing you do, and you'll remember it for years. It's worth doing, but not with young kids, and generally not unless you're at a place where the depression won't hit you. Remember to get


Did you even know there was the National Aquarium in DC? I think it costs $10 per person, and is very small. It's also all underground and well hidden. It also often has pop-up events. We saw and touched different bones of fish and amphibians that they brought out on a rolling table.


If you find a nice day, you should walk the mall, from the Washington Monument (definitely get tickets to go up, but there are more impressive high-up places to visit) past the reflecting pool to the Lincoln Memorial, then around Independence Avenue to the George Washington and MLK Memorials.

Off the Mall

Nearby the Washington Mall, but not part of the Smithsonian, is the Old Post Office Pavilion. It has a foo court, which is perfect for a cheap lunch instead of buying in the museums. But also check out the bell tower. It's free, and a simple elevator ride up. In my opinion, it has a much better view of the Mall over what the Monument can offer.

You should also go to the National Cathedral (did you know it's Episcopal, we Episcopalians do know how to go big and get the prime real estate). The garden is awesome for a walk or picnic, and check out the towers, they are the absolute best views of DC.

If you're at the Zoo, or just nearby, make time to see a movie at The Uptown. It's one of the most impressive movie theaters I have ben to. Lots of history, and I love that t has a balcony. I remember my dad taking me there to see Star Wars A New Hope (Episode IV) when I was really young.


Tuesday, March 5, 2013

Kids Activities

I find myself often in a situation where it's some morning, I have the kids for the afternoon, and I'm not sure what to do with them. We could go to a movie, or play Legos, but living near Washington, DC, I want the kids to love the museums as much as I do, or to see what else is going on.

This Sunday, while my wife was travelling, I took the kids to the Chocolate Festival in Old Town Fairfax. I didn't even know there wad an Old Town Fairfax, much less a chocolate festival. It was okay overall, but the best was seeing any type of chocolate you could imagine, and letting the kids pick something for themselves and their teacher.

For finding cheap or free stuff going on nearby with the kids, I have to say has consistently been the best. I tried (the Smithsonian Website) which is also good, but a little hard to navigate, partly because they have so much going on. At About I did a search of what to do with my kids this weekend, and a bunch of items came up. is really the best place to go.

I'll write about some specific things you must do if you're in DC. These are things I have shared with kids, teens and adults for years, and everyone is always impressed.


Monday, March 4, 2013

Comic Book Storage

After you get into comic books, you quickly come to realize you need some way to store them. There are a lot of details on exactly how to store comic books to last years. Heck, there are even companies that you can mail your comic boo to, and will put it I a clamshell to last years.

Honestly, I get comic books to read them, share them with others, and get my kids into them. Some might be worth money, but we're talking about maybe $20 for a few comics, and pennies for others. I would never make back the money I spent. At the same time, I do want then to look brand new for as long as possible. So, focusing on someone who doesn't want to spend much, and keep them safe but accessible, here's what the comic store has taught me.

Bags (Sleeves)

You need to get comic book bags. These are plastic (polypropylene) bags. You should get the Golden Age size. Comics today are more narrow than they used to be, so the Golden Age size doesn't give you a snug fit. But it does give you room to store actual graphic novels or comic books that are thicker than normal.


The bags are good to keep dust off, but they won't give you support to hold the comic up. It would still flop around, and the spine could crack if the comic was on an uneven surface. So, along with a pack of 100 bags, you also need to buy a pack of 100 board backs.

My comic book store sells a bag and board for 20 cents per comic. Personally I buy a pack of 100 sleeves and 100 backs, since it's a bit cheaper (about $16 total) and lasts a while.


To store comics, they have boxes made specifically to store comics. These are called long or short boxes. A long box is twice as long as a short box. I had a coupe short boxes starting out, and now have two long boxes. Most of them are 1/2 - 3/4 full, so I have a lot of room. A long box is really pretty big.

Again, these are pretty inexpensive. About $7 - $12 each. It's definitely worth picking up a small box. Even if you only get a few, you can box them up, put the lid on, and shelve them without worrying what might happen to the comics over time.


The recommendations I've read is to use a dry, warm environment. Essentially, keep them readily available to read, or at worst in a basement. Light will obviously fade them a bit. But I'm no where close to this being a problem since I'm so new. While a closet shelf would be best, I'm now using the floor in my office.

Have fun keeping the comics forever!


Sunday, March 3, 2013

Backing Up Movies

I have quite a few DVDs at this point, and a lot of devices (my Surface Pro and iPods) which can't play them (no DVD player built in). So I find I'm nervous about having the DVDs just laying around and would prefer to back them up. A few movies are coming out now with a digital download option, which I have found confusing to use (and you only have a year to download the movie), but it's better than nothing. So I find I really need some way to back up my movies on the computer so that if they were somehow lost, I could get them. On top of it, I would like the ability to bring my movies with me on the iPods or trips. To be clear, I wouldn't want to share the movies with people (beyond my kids), but I do find I need a way to back up DVDs.

After doing a bit of research and working with other options, the best and easiest option I have found is a mix of SlySoft AnyDVD and SlySoft Clone DVD Mobile. I know there are a lot of other options out there, but I really find SlySoft to be the easiest to use for cloning movies. It's worth mentioning that there is ALWAYS a 20% off sale on the site, so don't feel pressured to buy it immediately.

Here's how it all works. SlySoft AnyDVD scans any disc you put in the computer, and removes and copy protection. It doesn't copy movies or anything, and it's clearly stated to use only for backups of movies. But all by itself AnyDVD isn't going to copy movies.

After you have AnyDVD running (it always runs in the background) you can use any program to back up your video. I prefer Clone DVD since it seems to be the easiest one, and the files that it makes are pretty small. I generally choose the iPod format, ten use the defaults for the rest of the options. It takes about a hour to coy each DVD, but then you can store it safely.


Saturday, March 2, 2013

Securing Your PC

One of the biggest questions I get from people is what they should do to secure their computer. The Conversations go something like this:

Phone: ring... ring... (btw, it's the middle of the day while I'm working without Internet access)
Me: Hey, how are you doing?
Family member: Fine, but I had a quick question... I keep getting pop-ups that say my computer s infected, and my antivirus is out of date, so I should open the window and buy the clean-up service. Does this make sense?
Me: Do you have any security software installed now?
Family Member: The computer had something installed when it came, so I've just kept using that...

This then leads to some emergency troubleshooting, and the computer somehow ends up at my house while I try to get it fixed that evening, so the person isn't without a computer for a day.

Typically most of my family members also don't want to pay the annual fee for some service, so they try to find free alternatives, which seem to sometimes be worse than having nothing. Or a lot of programs I've used have really slowed down my PC. I remember one program that billed itself as having the smallest impact in system performance, but every now and then it would run and get stuck, using so many resources my whole computer was slower than dirt until I rebooted.

After a lot of reading of reviews, and finally pulling the trigger myself for my new computer, I recommend the following.


If you're cheap, or jut very low on funds, Microsoft has it's own Security Essentials which I have used for a few years and it's excellent. Microsoft makes clear that it will protect you, but it would be better to get a paid program. But I never had performance issues nor viruses or adware with this running. So it's a great free alternative, just make sure you are careful what sites you visit (no downloading BitTorrents).

Paid (Best)

PC Magazine has had consistently great reviews of software products. Based on their reviews, and reading user reviews on Amazon, Norton Internet Security is the best option (Norton 360 is also excellent, but the difference is it includes cleaners for your computer, which I never use. The price on Amazon is close to Internet Security, so I chose whatever was cheaper that day).

I've been running Norton 360 on two computers, and it has been excellent. Very easy to use, and generally runs in the background.

The one thing I recommend is checking Amazon each year when your renewal is up. The annual renewal through Norton is something like $70 per year, which seems crazy, even for 3 PCs. On Amazon Norton Internet Security is $22, so the next year you can buy Norton again, then put in the key to get another year of service. It's more work, but saves you about $40 per year.


Friday, March 1, 2013

Thinking Games

One of the things I’ve been blessed enough to get to do is read to my daughters class. In Second grade this was the highlight of my month. I got to pick any book I wanted, usually something a little off-normal, and watch the kids actual;y be interested in the story. In almost all cases I left the books behind so the kids could borrow them throughout the year.

I remember clearly how I read Crazy Hair by Neil Gaiman (picked up that morning in a rush from the Comic Book Store… They saved the day). After that I mentioned that there was another book, The Wolves in the Walls, but it was kind of scary, so I didn’t bring it. They unanimously decided they wanted The Wolves in the Walls, and asked me about it the next month. That book went over really well with them.

I usually got 15 minutes, and a book would take maybe 5 – 10 minutes, so I always had a few minutes left over to fill. At those times it’s always worth having a set of Rory’s Story Cubes handy. They have a set of things (vowels) and verbs (actions). You just roll a set and make up some story based on the pictures that come up.
In the class I would roll and make up the story for the kids. But at home or with friends we split the dice, so each person adds to the story. It’s similar to being at camp, where you go around the circle, each person adding to a story, but a little more directed which helps move things along.

For example, with this roll:

I get:

Once there was a boy who was in love with apples. He was drawn to them like a magnet to steel, nothing could keep them apart. He could sniff out an apple no matter where it was, his nose was an apple compass. He loved apples so much, his mother decided to take him to an orchard, where he had a great time pointing out apples that had fallen among the flowers.

While he was pointing out one specific, beautiful apple, a swarm of bees came down on him. The swarm landed on him like a star falling from the sky. He was quickly burning everywhere from the stings.

The boy hadn’t realized that he had accidentally stepped on a bee hive. In case you didn’t know, the bee hive is like a pyramid, a sacred shrine that they also get to call home and work in, alongside their queen. This specific bee sat upon her throne, ruling over her subjects while she devoured everything in her path, like a swarm of beetles protecting the throne and burrowing under the skin of anyone who comes near, devouring them from the inside out.

Anyone else have a simple, fun thinking game?