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.

Peace.

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.

Peace.

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.

Peace.

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.


Smithsonian

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.

Hirshorn

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.

Sackler

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.

Holocaust

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
tickets.

Aquarium

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.

Memorials

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.

Peace.

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 About.com has consistently been the best. I tried si.edu (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. dc.about.com 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.

Peace.

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.

Boards

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.

Boxes

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.

Storage

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!

Peace.

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.

Peace.